OT -- AppleScript Help

Bruce Robertson bfr at nwlink.com
Wed Oct 28 21:27:39 EDT 2009


Not relevant.

You're talking specifics of an extremely simple script.

I'm talking about generalities of applescript programming.

This was the subject of a hundred+ message multi week thread on the  
applescript list.

You can get into performance and conflict and confusion issues when  
tell statements are used where they are not necessary.

In this very case, you're issuing a command to Finder that is not a  
Finder command.

Finder doesn't understand choose folder; so it passes the command up  
the object hierarchy. Your use of the command in this way reveals that  
you don't know what it belongs to. By itself, a marginal error.

But it is like trying to tell some property of a stack to do something  
that it doesn't do.

> Bruce Robertson wrote:
>> It is best practice to eliminate tell statements where they are not  
>> required.
>>
>> Finder is not necessary for this command.
>>
>> choose folder
>> set f to result
>
> It does not affect anything: result is the same with or without  
> "tell" on a folder selection
>
> alias "Varuna:Ekadanta Kulam:Database:EMBs:733:"
>
> then an attempt
>
> tell application "Finder"
> open alias "Varuna:Ekadanta Kulam:Database:EMBs:733:"
> end tell
>
> fails: result: "missing value"
>
> Oddly though, "reveal" works....
>
> tell application "Finder"
>   reveal alias "Varuna:Ekadanta Kulam:Database:EMBs:733:"
> end tell
>
> why not "open"  ??

Well; why not close?
Or delete, or rename?

Open and reveal are completely different commands.

Maybe it would be clearer if you consider the same command sent to a  
Word document.

Having Finder reveal the document and having Finder open the document  
get very different results.

Having Finder open a folder shows you the contents of the folder.

Having Finder reveal the folder shows you the folder.




More information about the use-livecode mailing list