Re: Weird AppleScript Problem
Re: Weird AppleScript Problem
- Subject: Re: Weird AppleScript Problem
- From: Shane Stanley <email@hidden>
- Date: Mon, 05 Dec 2011 21:44:14 +1100
On 05/12/2011, at 9:03 PM, Thomas Fischer wrote:
perhaps somebody can point me to an easier and more efficient method
If you're happy to use ASObjC Runner:
script lossyASCII set theString to current application's NSApp's convertedValue() -- lossy conversion to ASCII data set theData to theString's dataUsingEncoding_allowLossyConversion_(current application's NSASCIIStringEncoding, true) -- convert back to text return current application's NSString's alloc()'s initWithData_encoding_(theData, current application's NSUTF8StringEncoding) end script
tell application "ASObjC Runner" to set theResult to run the script {lossyASCII} converting "Àª©çº" with result returned
0000.000 -- Start -- 0000.011 Result --> Aa(C)co
|
_______________________________________________
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