Choose file/folder unicode allergy
Choose file/folder unicode allergy
- Subject: Choose file/folder unicode allergy
- From: Steven Angier <email@hidden>
- Date: Fri, 13 Sep 2002 14:24:30 +1000
The commands "choose file" and "choose folder" choke on prompts supplied as
unicode strings (OS 9.2.1 / AS 1.8.3):
set thePrompt to "Pick a file, any file." as unicode text
choose file with prompt thePrompt
--> displays prompt "Choose a file"
set thePrompt to "Pick a folder, any folder." as unicode text
choose folder with prompt thePrompt
--> displays prompt "Choose a folder"
Under Mac OS X (OS 10.1.5 / AS 1.8.3), the situation is even worse since all
string literals are compiled as unicode!
set thePrompt to "Pick a file, any file."
choose file with prompt thePrompt
--> displays prompt "Choose a file"
set thePrompt to "Pick a folder, any folder."
choose folder with prompt thePrompt
--> displays prompt "Choose a folder"
Is there a way to coerce a unicode string back into into plain text? Nothing
I try seems to work:
set thePrompt to thePrompt as string
set thePrompt to thePrompt as text
set thePrompt to thePrompt as styled text
set thePrompt to "" & thePrompt
set thePrompt to {thePrompt} as text
set thePrompt to item 1 of text items of thePrompt
Only "choose file" and "choose folder" seem to have a problem with this;
"display dialog", "choose file name", and "choose from list" all work
properly with unicode strings.
Steven Angier
Macscript.com
_______________________________________________
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.