Re: Opening SD's EnclosingFolder
Re: Opening SD's EnclosingFolder
- Subject: Re: Opening SD's EnclosingFolder
- From: Rob Jorgensen <email@hidden>
- Date: Tue, 5 Mar 2002 13:15:45 -0500
On 3/5/02, someone named Gnarlodious asked:
Did someone write a script for Script Debugger's script menu that will open
the enclosing Finder window of the frontmost script?
Thanks
Here's a quick attempt. It may need further refinement but this works
on my setup and should be a good starting point.
-- Begin Script - watch for line wraps --
tell application "Script Debugger" to set scriptPath to file spec of
front script window
if scriptPath is missing value then
display dialog "The current script hasn't been saved to disk. No
further action will be taken." buttons {"OK"} default button 1 giving
up after 5
error number -128
end if
tell application "Finder" to set folPath to container of scriptPath as text
set folderInfo to info for folPath -- I may have a hidden coercion
going on here so this might need to be "set folderInfo to info for
folder folPath"
tell application "Finder"
if name of folderInfo is not "Desktop Folder" then
open folder folPath
else
tell application "Script Debugger" to display dialog "This script is
in the Desktop Folder (it can't be opened)." buttons {"OK"} default
button 1
end if
end tell
-- End Script --
--
Rob Jorgensen
http://macscripter.net/ - Your best source for all things AppleScript
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.