Revealing a folder on Mac
Sarah Reichelt
sarah.reichelt at gmail.com
Thu Nov 10 22:17:41 EST 2005
> on folder_Open someFolder
> replace "/" with ":" in someFolder
> put line 1 of the volumes into startUpDisk
> -- "Macintosh HD:Applications:Revolution 2.6.1:"
> put startUpDisk before someFolder
>
> put "tell application" && kwote("Finder") into someAppleScript
> put return & "activate" after someAppleScript
> put return & "open folder" && kwote("[[someFolder]]") after
> someAppleScript
> put return & "end tell" after someAppleScript
> put merge(someAppleScript) into someAppleScript
> do someAppleScript as AppleScript
> end folder_Open
>
>
> Does this work for people?
Yes, it works for me (Mac OS X 10.4.3) but I prefer to let Rev do the
work of finding the correct path for AppleScript. Also I have never
used the merge function and can't really see why it is needed. Here is
my version, which includes an error check at the end:
on folder_Open someFolder
put revMacFromUnixPath(someFolder) into someFolder
put "tell application" && kwote("Finder") into someAppleScript
put return & "activate" after someAppleScript
put return & "open folder" && kwote(someFolder) after someAppleScript
put return & "end tell" after someAppleScript
do someAppleScript as AppleScript
if the result is not empty then answer error "Can't open folder "
& someFolder & cr & the result
end folder_Open
Note: I always use cr instead of return to make a new line as I like
to reserve the "return" keyword for sending values back from
functions.
Cheers,
Sarah
More information about the use-livecode
mailing list