• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Choose file/folder unicode allergy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Choose file/folder unicode allergy
      • From: John Coelho <email@hidden>
    • Re: Choose file/folder unicode allergy
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Display dialog frontmost?
  • Next by Date: Error resolving references
  • Previous by thread: Two questions - on the dumbish side
  • Next by thread: Re: Choose file/folder unicode allergy
  • Index(es):
    • Date
    • Thread