Re: Is: Setting File & Creator Type access error
Re: Is: Setting File & Creator Type access error
- Subject: Re: Is: Setting File & Creator Type access error
- From: Philip Aker <email@hidden>
- Date: Thu, 2 Jul 2009 11:49:46 -0700
On 2009-07-02, at 11:06:15, Paul Berkowitz wrote:
That's not System Events vs. Finder.
It's because your script *tells* the object whereas the first
script just
tells the application and tries to set a list or properties 'of'
the object.
That's how it works, and always has. You can only set multiple
properties -
a list of properties - of an object to a list of values if you
tell the
object directly. You can *get* values of a list of properties
either way.
At least, that has been my experience over several years. I have
just come
upon replies from others that indicate I may have been leading a
sheltered
life, and that this behavior may differ from application to
application. if
that is indeed the case, I defer to others' greater knowledge.
Could be, but since the Finder is traditionally and overwhelmingly
the application in question:
set f to ((path to desktop folder as text) & "test.txt") as alias
tell application "Finder" to tell (document file f)
set {file type, creator type} to {"DISH", "DHAT"}
end tell
info for f
Aren't you just making my original point, that it has nothing to do
with Finder vs. System Events, but rather to do with the necessity
of telling the direct object if you want to set a list of its
properties all at once?
I was suggesting that you are eligible to retract the retraction :-).
I have hit the same thing with several other applications, in
particular Microsoft Entourage. But since I have not tried it with
every application, perhaps those who think it's related to the
application might come up with one where that matters. Perhaps both
conditions matter? Thanks for confirming that it doesn't have
anything to do with the Finder vs. System Events.
Scripting behaviors are governed by the individual application. Since
setting multiple properties of a file system object is handled both by
the Finder and System Events using the same address form, surely one
can say this is the standard behavior. Therefore I think that if an
application overrides the standard behavior then it has the
responsibility to document the deviance and can't really be a factor
in determining whether or not you've been leading a sheltered life.
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
Democracy: Two wolves and a sheep voting on lunch.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden