Re: about the use of character id
Re: about the use of character id
- Subject: Re: about the use of character id
- From: "emile.a.schwarz" <email@hidden>
- Date: Tue, 02 Sep 2014 11:27:32 +0200 (CEST)
Hi,
AppleScriptLanguageGuide.pdf page 123 says:
For information on compatibility with previous AppleScript versions, including the use of string and Unicode text as synonyms for text, see the Special Considerations section.
All three gaves me the same (bad) results.
Some hours and some boots later: still does not works on all three synonyms (text, string and Unicode text).
The real code is:
tell application "Finder"
set i to 32
set zeResult to ""
set zeChar to ""
repeat 200 times
set zeChar to character id i # Unable to get character id 32
set zeResult to zeResult & tab & zeChar & return
set i to (i + 1)
end repeat
return zeResult
end tell
the two lines after the repeat statement was originally:
set zeResult to zeResult & tab & string id i & return
I split the line because of the error (to try to workaround the error).
Emile
My original script used the deprecated ASCII Character, but the same pdf tells me: “deprecated starting in AppleScript 2.0”.
-- Answer to:
According to Standard Additions, the official syntax is not
Unicode text id anIntegerValue
it's
character id anIntegerValue.
ASCII character v : Convert a number to a character
ASCII character integer : the code point of the specified character
→ text : the character
This command is deprecated; use ‘character id …’.
The script :
set i to 32
character id i
behaves flawlessly.
_______________________________________________
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