• 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
Re: NSAppleScript shies away from porcupines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAppleScript shies away from porcupines


  • Subject: Re: NSAppleScript shies away from porcupines
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 26 Aug 2008 23:34:07 +0700


On 26 Aug 2008, at 20:58, Jason Coco wrote:


On Aug 26, 2008, at 04:19 , Gerriet M. Denkmann wrote:


On 26 Aug 2008, at 15:04, Andrew Farmer wrote:

On 26 Aug 08, at 00:39, Gerriet M. Denkmann wrote:
I want to open some file:

source =
"tell application "SomeApp"...

You're making things harder than they need to be.

[[NSWorkspace sharedWorkspace] openFile:@"/path/to/file" withApplication:@"SomeApp"];

As to AppleScript's Unicode support, I wouldn't be surprised if it were still unreliable.

Sorry for the badly abridged example. Actually I want to do more than just open the file.
Or is it definitely impossible to use un-American pathnames in AppleScript?


I did a test with this... it seems that the code to resolve the alias in AppleScript doesn't like
non-latin encoded pathnames. If you give it a regular file and don't ask it to resolve an
alias, it happily works... even with non-English (I don't know Thai? so I used Japanese characters
for the test, but I'm assuming it works pretty much the same--I know, dangerous to assume such
things from computers, right? :) )... but if you ask it to resolve an alias, it dies with the same
error message that you were getting (String encoded with \uNNNN in place of actual UTF-16
values).

Could you tell me the exact appscript code?

When I try in Script Editor:

tell application "Finder"
	set macpath to POSIX file "/Volumes/เม่น/Users" as Unicode text
	open information window of macpath
	activate
end tell

and do "Compile", then this gets transformed into:

tell application "Finder"
set macpath to file " ‘ßÀÏ:Volumes:‡¡Ëπ:Users" as Unicode text
open information window of macpath
activate
end tell


and a subsequent "Run" complains (quite understandable) about this ridiculous path.

So, if "as alias" does not work, what exactly to use instead?


Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSAppleScript shies away from porcupines
      • From: Charles Srstka <email@hidden>
References: 
 >NSAppleScript shies away from porcupines (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSAppleScript shies away from porcupines (From: Andrew Farmer <email@hidden>)
 >Re: NSAppleScript shies away from porcupines (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSAppleScript shies away from porcupines (From: Jason Coco <email@hidden>)

  • Prev by Date: Re: error: invalid lvalue in assignment
  • Next by Date: Re: NSAppleScript shies away from porcupines
  • Previous by thread: Re: NSAppleScript shies away from porcupines
  • Next by thread: Re: NSAppleScript shies away from porcupines
  • Index(es):
    • Date
    • Thread