How to open a window in the Finder please?

Klaus Major klaus at major-k.de
Tue Mar 9 04:58:08 EST 2004


Bon jour François,

> Hello!
>
> Is it possible to open a window in the finder from a button on the 
> card?
>
> In fact, I want to put on my card a button whos says "show Folder 
> Résultats
> in Finder" (of course, the label's button will be shorter!:-)
>
> Thank you very much every body!

This littel handler will open a folder just like doubleclicked in the 
finder...

You just have to supply the path to the folder you want to be opended.

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

Applescript is needed, of course...



This one will show and select a file in a finderwindow,
in case you need this one, too ;-)

Here the complete path to the file has to be supplied

on apfelschreib pfad
   set the itemdel to "/"
   put item -1 of pfad into datei
   delete item -1 of pfad
   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 apfelschreib

Hope that helps...

> Amicalement
> François

Regards

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



More information about the use-livecode mailing list