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

NSString in ApplescriptObjC


  • Subject: NSString in ApplescriptObjC
  • From: Robert Stott <email@hidden>
  • Date: Thu, 10 Apr 2014 11:06:07 +0000 (GMT)

Hi all,

I've come across a confusing (to me anyway) problem which I hope you folks might be able to help me with. 

I have an AppleScriptObjC based app which basically creates a text file by concatenating three strings. The first string and third strings are AppleScript variables (e.g set myString to "foo"). The second string is read from a file within the app's bundle like this:

        set pathToResources to (current application's class "NSBundle"'s mainBundle()'s resourcePath()) as string
        set pathToThePS to pathToResources & "/bc.ps"
        set thePS to NSString's alloc()'s initWithContentsOfFile_encoding_error_(pathToThePS, 0,missing value)


…I then stick the strings together and write them out to a file like this:

            set theOutputText to psPrefix & return & thePS & return & theSuffix

            set theString to NSString's stringWithString_(theOutputText)

            theString's writeToFile_atomically_(theSavePath, true)


It works perfectly with the *exception* of when the Mac's language is set to Japanese (System Preferences>Language & text>Language). I can't even open the text file in TextWrangler to see what the problem is.


Has anyone experienced anything similar, or have any suggestions?


Thanks

Rob







 _______________________________________________
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

  • Follow-Ups:
    • Re: NSString in ApplescriptObjC
      • From: Shane Stanley <email@hidden>
    • Re: NSString in ApplescriptObjC
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Recent Items
  • Next by Date: Re: Recent Items
  • Previous by thread: Re: Recent Items
  • Next by thread: Re: NSString in ApplescriptObjC
  • Index(es):
    • Date
    • Thread