Re: Not seeing AppleScript dictionary
Re: Not seeing AppleScript dictionary
- Subject: Re: Not seeing AppleScript dictionary
- From: Shane Stanley <email@hidden>
- Date: Tue, 10 Jun 2003 13:20:02 +1000
On 10/6/03 10:35 AM +1000, Stan Cleveland, email@hidden, wrote:
>
I'm having a problem that is occurring frequently and predictably with a
>
variety of applications. In certain circumstances, an application's
>
dictionary appears to be inaccessible. The problem can be shown with the
>
following script:
>
>
tell application "QuarkXPress 4.11"
>
set theInfo to horizontal measure of default document 1
>
activate
>
display dialog theInfo as text
>
end tell
>
>
When run (in OS 9, of course) from Script Editor the dialog displays
>
"inches". Saved as an applet in the startup items folder, after rebooting
>
the dialog displays "<<constant ****UINC>>". Similar results can be obtained
>
using any application that returns application keywords (as opposed to
>
literals like strings or integers) as a script result.
>
>
The problem showed up a month or two ago. Any solution or workaround for
>
this frustrating bugaboo would be much appreciated.
What you're seeing is the way AS works. Application keywords aren't saved
with applets; the raw codes are only converted to the keywords when you open
the script in an editor. So you have do something like:
tell application "QuarkXPress 4.11"
set theInfo to horizontal measure of default document 1
if theInfo = inches then
set theInfo to "inches"
else if ...
...
end if
activate
display dialog theInfo as text
end tell
--
Shane Stanley, email@hidden
_______________________________________________
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.