BUG? Constants to string
BUG? Constants to string
- Subject: BUG? Constants to string
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 04 Jan 2002 13:30:24 -0800
Can anyone explain what's going on here? This is in AS 1.8.1 on OS 10.1.2,
but it has existed previously, at least back to AS 1.6 in OS 10.1 and 9.1
(9.2.1?) in the second example.
If I run this script from Script Editor:
tell application "Finder"
set p to owner privileges of alias "OS X HD:Users:berkowit:Desktop:Text
File.txt"
set txt to p as string
end tell
display dialog txt
--> read write
If I save it as an application, I get
--> <<constant ****rdwr>>
Similarly if I write it to a text file: "read write" when run in any Script
Editor, <<constant ****rdwr>> when run from an application.
(According to Script Debugger's Dictionary, the raw code for read write is
<<constant rdwr>> (just 4 characters).)
--------------
Similarly:
Entourage uses application constants for 'priority' property of tasks and
messages. The possible constants for priority are lowest, low, normal,
high, highest. Let's take normal.
If I'm working in Script Editor , and run:
tell application "Microsoft Entourage"
set theTask to task 1
set p to theTask's priority
set txt to p as string
end tell
display dialog txt
--> normal
If I save the script as a compiled script and run it from Entourage's own
script menu, I get
--> <<constant ****!nrm>>
If I save it as an application and run it there, I get
--> <<constant ****!nrm>>
If I write txt to a text file, it writes "normal" when run from both Script
Editor and Entourage, but if I quit Entourage and relaunch it, then it
writes "<<constant ****!nrm>>". According to Script Debugger's Dictionary,
the raw code for normal is <<constant !nrm>> (just 4 characters).
This is creating something of a muddle, and the need for extensive
workarounds. Does anyone know what this is about? Is this a bug or a
"feature" (some feature!) of AppleScript? And is it recent or ancient?
--
Paul Berkowitz