Re: Icon view dilemma
Re: Icon view dilemma
- Subject: Re: Icon view dilemma
- From: Chris Page <email@hidden>
- Date: Sun, 23 Jan 2011 03:47:43 -0800
On Jan 23, 2011, at 3:23 AM, OzSanta wrote: The following script works fine run from the script editor, but when placed in the user scripts folder and run from the Applescript icon menu, it returns '«constant ****narr»' in stead of 'not arranged'.
In general, scripts can't convert terminology to text. i.e., you can't reliably decompile programmatically. However, it happens to work in certain circumstances for certain values. If you want to reliably display the text "not arranged" when you receive the value from Finder, you'll need to perform that conversion yourself, e.g.:
tell application "Finder" set temp to icon view options of window of desktop set ArrangementValue to arrangement of temp if (ArrangementValue is arranged by name) then "arranged by name" else if (ArrangementValue is (not arranged)) then "not arranged" end if
display dialog the result end tell
"«constant ****narr»" is what you get when a value is decompiled and the corresponding terminology isn't available or when the decompiler doesn't know which application the term comes from. "****narr" is the eight-byte code for the not arranged term.
AppleScript Editor makes more of an effort to make this sort of thing work for scripts running within it, primarily for use by the Event Log and Results, which may be why it works for your case, but you should never rely upon it if you want to write general-purpose scripts.
-- Chris Page
The other, other AppleScript Chris
|
_______________________________________________
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