Opening a Folder on the Desktop |
|
Enjoy!on mouseUp answer folder "Get a folder:" if it <> "" then OpenFolder it end if end mouseUp on OpenFolder pPath switch (the platform) case "Win32" set the hideConsoleWindows to true if the shellCommand is "cmd.exe" then create alias "C:/Temp.lnk" to file pPath get shell("C:\Temp.lnk") delete file "C:/Temp.lnk" else get shell("start" && quote & pPath & quote) end if break case "MacOS" if the systemVersion >= 10 then get shell("open " & pPath) else put "tell application " & quote & "Finder" & quote & cr & \ "activate" & cr & \ "open folder " & quote & ConvertPath(pPath) & quote & cr & \ "end tell" into tScript do tScript as AppleScript end if break end switch end OpenFolder function ConvertPath pPath if char 1 to 9 of pPath = "/Volumes/" then delete char 1 to 9 of pPath else put line 1 of the drives before pPath end if replace "/" with ":" in pPath return pPath end ConvertPath
Posted 10/23/2002 by Ken Ray
Revised 10/24/2002 by Ken Ray
Close this window | Print this window |