Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'perhaps make it a droplet' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
perhaps make it a droplet
Authored by: garbanzito on Jun 14, '02 03:14:17AM

nice idea. another approach would be to make it a droplet. also "quoted form" will be more flexible with odd characters in the file name. save as a stay open application to avoid having to wait for the droplet to launch:

-- if files dragged on
on open (the_files)
repeat with a_file in the_files as list
if {".dmg", ".smi", ".img"} contains (text -4 through -1 of (a_file as string)) then
do shell script "hdiutil mount " & quoted form of POSIX path of a_file
end if
end repeat
end open

-- if user double-clicks
on run
set f to (choose file with prompt "choose an image to mount") as list
open (f)
end run



[ Reply to This | # ]