OT -- AppleScript Help
Sivakatirswami
katir at hindu.org
Thu Oct 29 01:39:34 EDT 2009
Bruce, your point is well taken for future needs, but in fact I'm not
actually using "choose folder"... it was just suggested as a diagnostic
to verify path...as a test... the path I'm using is correct:
the problem script is:
tell application "Finder"
open alias "Varuna:Ekadanta Kulam:Database:EMBs:733:"
end tell
#result: missing value
and I tried just
open alias "Varuna:Ekadanta Kulam:Database:EMBs:733:"
sans the "tell" and that definitely does not work.
I can live with "reveal" for now... that works...
See other note: revCopyFile (uses applescript in the background) also
started failing today... a test to copy a file form the server to my
hard drive failed...I don't know where that script is, but applescript
will not even read from the mounted server volume
I better move this over to the Applescript list (can you send me the
URL?) because it's turning into a bigger issue: some network protocols
changed or something and Applescript 2.0.1 running on 10.5.8 is no
longer a happy camper with I/O over the LAN... or the way mount points
are now configured on the client machine running the scripts.. for
reasons that are still mysterious. .dunno, I'm no expert.... I'll check
with our net/server admin here if any changes/upgrades were made in the
last 3 days since these all worked fine on Saturday, last...if they
upgraded OSX Server to Snow Leopard that could be the problem...
But... (he thinks of a work around)
Ha.. Shell is our friend,
put ("open " & quote & "/Volumes/Varuna/Ekadanta
Kulam/Database/EMBs/" & tStudentFolder & quote) into tShell
get shell (tShell)
works perfectly! Folder opens as expected.
good by Applescript (for today)
But I will assiduously avoid tell when not needed! thank you for that
pointer.
skts
Bruce Robertson wrote:
> 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.
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list