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.
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.