Reveal file or folder in Finder?

James.Cass at sealedair.com James.Cass at sealedair.com
Mon Jan 19 14:46:26 EST 2004


Here's another version of the Reveal.  I cobbled this together with help 
from a Google search from a previous post by Ken Ray.
( 
http://lists.runrev.com/pipermail/use-revolution/2003-September/022982.html 
)
I'm not sure how to handle this on the Windows side, but the Mac code 
below should do what you want.

--  begin --
on mouseUp
  answer file "Select a file"
  put it into f  -- this gives the full path to the file
  set the itemDel to "/"
  put item 1 to -2 of f into folderPath
 
  switch (the platform)
  case "MacOS"
    put revMacFromUnixPath(f) into macFilePath
    put "tell application" && quote & "Finder" & quote & cr & \
        "reveal" &&  quote & macFilePath & quote & cr & \
        "end tell" into applescripttext
    do applescripttext as applescript
    break
 
  case "Win32"
    -- For Windows
    -- ??
    break
  end switch
end mouseUp
--  end --


Hope this helps,
James







Klaus Major <klaus at major-k.de>
Sent by: use-revolution-bounces at lists.runrev.com
01/19/04 01:48 PM
Please respond to How to use Revolution
 
        To:     How to use Revolution <use-revolution at lists.runrev.com>
        cc: 
        Subject:        Re: Reveal file or folder in Finder?


Hi Frank,

> Hi,
>
> Does anyone have a script that will reveal a file or folder in the
> Finder?

Use this mix of Transcript and Applescript ;-)

on el_revealo pfad # path
replace "/" with ":" in pfad
put "tell application " & quote & "Finder" & quote & cr &  "activate"
\
& cr & "reveal " & quote & pfad & quote & cr & "end tell"
into tScript
do tScript as AppleScript
end el_revealo


replace "reveal" with "open" in the script and the file will open like
on a doubleclick in the finder...

> Same goes for Windows.

Yeah, i also would like to know this :-)

> Thanks in advance,
> -- Frank Leahy

Regards

Klaus Major
klaus at major-k.de
www.major-k.de

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution


More information about the use-livecode mailing list