Jump to content

The official custom AppleScript thread.


  • Please log in to reply
21 replies to this topic

#21
Dalton63841

Dalton63841

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 295 posts
  • Gender:Male
I am having trouble with an Applescript app Im making. I have it set up to run a script on launch to find the disk number, and pass that as a property. Here is the code:

[codebox]property diskNumber : {}
property listOfDisks : every word of (do shell script "diskutil list | grep EFI | grep -o -e disk[0-9]s[0-9]") as list

on launched theObject
if (number of items of listOfDisks) is greater than 1 then
display dialog "Multiple EFI partitions have been found.
Please choose a partition:" buttons listOfDisks
set the button_pressed to the button returned of the result
set diskNumber to the button_pressed
else
set diskNumber to item 1 of listOfDisks
end if
log diskNumber
end launched
[/codebox]
The problem is that when I launch it, it just throws an applescript error: No result was returned from some part of this expression.(-2763)

No display dialog ever comes up or anything. Any ideas why this isn't working?

#22
Dud3m@n

Dud3m@n

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
Hi everyone,

I have searching high and low through various mac forums and have been somewhat unsuccessful in reaching my goal. What I'm trying to achieve is have an automated process on my iMac (Mid 2010 - Core i3 - 16Gig RAM - Mavericks 10.9.5) which will change the folder's icon as it is dropped onto the Automator applet. The principle I had in mind is that, as the movie folder is dropped onto the applet, it will take a generic file called either folder.jpg or poster.jpg, then convert the image into an ICNS file and finally take the ICNS file and make it the folder's new icon. This process is to also be looped, meaning to scan all sub-folders and if a JPG is present to use it for that same named corresponding folder. All files and folders in question located on a ReadyNas Duo V2 with guest access and full R W X permissions. I'm aware of the manual process which is to right click on folder and select get info, then simply drag the poster.icns file onto the folder in the top right of get info window. Really wish it could be automated.

From the screenshot, you see what I'm trying to achieve. For now I have found a couple scripts (found online) which allow me to retrieve movie.xml and Cover information online and save these in their respective folders. Now that Covers are downloaded as JPG files named as the movie folder. I would hope that there is automated process which can assist at changing multiple folder icons.

Any help or guidance would be greatly appreciated. If anybody is able to assist, I can post the AppleScript that I have started working on for further analysis.

Ps if this post is in the wrong area, please advise, I'm a noob here.

Thank you in advance. Have a great day all
Dud3m@n

iMac, OS X Mavericks (10.9.5)

Attached Files







0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2015 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy