• 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: NSString in ApplescriptObjC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString in ApplescriptObjC


  • Subject: Re: NSString in ApplescriptObjC
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 11 Apr 2014 00:01:52 +1000

On 10 Apr 2014, at 9:06 pm, Robert Stott <email@hidden> wrote:

>             set theOutputText to psPrefix & return & thePS & return & theSuffix
>             set theString to NSString's stringWithString_(theOutputText)
>             theString's writeToFile_atomically_(theSavePath, true)

I just noticed this: don't use writeToFile:atomically:. It was deprecated in OS X 10.4, and you should *never* write a string to file without setting an encoding.

Try something like this instead:

set theString to NSString's stringWithFormat_("%@%@%@", psPrefix, thePS, theSuffix)
theString's writeToFile_atomically_encoding_error_(theSavePath, true, current application's NSMacOSRomanStringEncoding, missing value)


--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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


References: 
 >NSString in ApplescriptObjC (From: Robert Stott <email@hidden>)

  • Prev by Date: Re: NSString in ApplescriptObjC
  • Next by Date: Re: names of a record's items
  • Previous by thread: Re: NSString in ApplescriptObjC
  • Next by thread: QuickTime Pro 7 Captions
  • Index(es):
    • Date
    • Thread