Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Mechcozmo

macrumors 603
Original poster
Jul 17, 2004
5,215
2
I am building a Folder Action that can automatically mount a disk image. I'm not the best at AppleScript, but I was able to hack out this code:


set the file_img to (file type is "dmg")
set the file_toast to (file type is "hlmg")

tell application "Finder"
set the chosen_folder to (choose file type of file_img or file type of file_toast with prompt "Image to open…")
end tell

tell application "Toast Titanium 5.2.1"
activate
mount image chosen_folder
quit
end tell



As you can see, I'm using Toast to do the mounting, etc. That works fine. But I am having trouble more with the first two lines, where I define the types of images. I got the Toast one by getting info on it, and the type was listed as 'hlmg' while I made my best guess at the other disk image. I am getting the error:
NSCannotCreateScriptCommandError
When I try to run the program. It stops on the first line, near the end.
If anyone knows more than I do, (just about everyone), please help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.