OT: Show and Select in Finder

Klaus Major klaus at major-k.de
Wed Mar 2 10:09:02 EST 2005


Hi Swami,

> I do a lot of processing of long lists of files through Revolution  
> interfaces, I'm continually amazed at the ease with which Revolution  
> allows me to deal with data in 1000's of files on disk with such  
> efficiency and speed,  (mostly web files) and hack up tools on the  
> spot as needed - nothing else can compare </end_kudos_>
>
> OK, new need. I have a file listing like this brought in from an  
> Interarchy link checking process.
>
> http://www.hinduismtoday.com/info/advanced_search.html
> http://www.himalayanacademy.com/basics/tenq/index.htm
> http://www.himalayanacademy.com/resources/multi-media/
>
> (list continues for 3000 plus lines)
>
> One can transform these to paths to the production server on the lan
>
> /Volumes/WWW/LIve_Sites/www.himalayanacademy.com/info/ 
> advanced_search.html
>
> and boot them into BBEdit using the launch command... But there are  
> times when one wants a
>
> "Show in Finder" command that will switch apps to the finder, and open  
> the window-folder containing the file and select it... I believe this  
> would be an Apple script thing... before I go digging, does anyone  
> already have such a recipe?

Yes :-)

on mouseUp
   put fld 1 into pfad
  ## This is the filename!
  ## pfad = german for path

   replace "/" with ":" in pfad
   put "tell application " & quote & "Finder" & quote & cr &  "activate"  
& cr & "select " & quote & (pfad) & quote & cr &  "end tell" into  
tScript
   do tScript as AppleScript
end mouseUp

Et voila, the file is show AND selected! in its parent window in the  
finder.

> Thanks
> Sivakatirswami

Best

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list