Re: Can't set creator type
Re: Can't set creator type
- Subject: Re: Can't set creator type
- From: Mr Tea <email@hidden>
- Date: Tue, 24 Feb 2004 09:50:44 +0000
On 24 Feb 2004, at 2.01 am, Paul Berkowitz wrote:
Also, why are you converting the Finder reference to alias if you plan
to do
further Finder operations (getting and setting creator type)? It
doesn't
hurt, but it's fine without too.
(Also, why keep getting 'text returned' over and over, since you're not
getting any other property. Why not just set a variable to it once and
for
all?)
The key phrase in my original message, Paul, was '...based on a snippet
from a much longer script...'. That script gets Finder object
references passed to it as aliases, so when I started debugging the
script I needed to convert the Finder reference to an alias so that it
didn't screw up everything else.
As for getting 'text returned' over and over, that doesn't happen in
the original script either, which actually sets a variable to the value
of a field returned from a 24U Appearance dialog.
I hope that explains the shortcomings of the snippet, which was hastily
cobbled together to illustrate a problem using results returned from
dialogs. Next time, I will try to excise every possible blasted
inefficiency or needlessly sodding repetetive routine from the code I
post here, so that it shines like a little jewel of good AS practice
and does not distract the reader from the question that I am actually
asking. Then I won't have to get all burned up at this sort of
response.
I shouldn't moan, though, because as usual, Paul, the part of your
reply that dealt with my question was right on the money...
'text returned' may be Unicode now. 'creator type' has to be real plain
text. Use the <<class ktxt>> of (text returned of dRes) as record'
method
to get the plain text.
Unicode it is, as I had found out by slipping a 'display dialog class
of theVariable' line into my script. Is this really the only way to
convert 'text returned' into 'real plain text'. No wonder my pathetic
attempts at coercing with 'as text' or 'as string' failed. I knew what
I wanted to do, but not how to do it.
So, prior to Panther, this line of my orignal script returned a usable
result:
set theCode to the value of fCode
But now I need to do this:
set theCode to <class ktxt> of (the value of fCode as record)
Frankly, that stinks. How is a newbie scripter supposed to figure that
one out? Or even a fairly experienced scripter like myself? Whatta gyp!
Ridiculous. Crass. Absurd.
And why no joy when I tried setting the file's creator with System
Events? It says in the System Events dictionary that the 'creator type'
property is unicode text. Well, so was the result I was trying to put
there, but it didn't go.
All very dispiriting.
Nick
pp Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.