• 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
NSAppleScript and script editor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript and script editor


  • Subject: NSAppleScript and script editor
  • From: Dominik Wagner <email@hidden>
  • Date: Wed, 29 Mar 2006 14:36:59 +0200

Hi there!

I try running an apple script using NSAppleScript inside my application. The problem I'm having is that the result of the script differs, and I need to know why it does. The script is simple:

tell application "Address Book"
	((path to resource "InfoPlist.strings") as text)
end tell

and in Script Editor it returns the correct result:
"Dom:Applications:Address Book.app:Contents:Resources:English.lproj:InfoPlist.strings"


The problem now is, when I put this script into a cocoa application, load it with NSAppleScript initWithContentsOfURL: error:
and then execute it with executeAndReturnError: the result is the following error:
{
NSAppleScriptErrorBriefMessage = "A resource wasn't found.";
NSAppleScriptErrorMessage = "Address Book got an error: A resource wasn't found.";
NSAppleScriptErrorNumber = -192;
NSAppleScriptErrorRange = <00000000 00000000 >;
}


Is this any known bug? Can I do something about it? does the execution environment of the script editor differ substantially to my little cocoa app?

I packed it into a small demo that can be found at
http://www.tauschinger.de/cocoa-dev/NSAppleScriptTest.zip

help is greatly appreciated,
   Dominik

--
Dominik Wagner          Mail: email@hidden
TheCodingMonkeys        http://www.codingmonkeys.de/
Blog - DasGenie: !Scrap http://scrap.dasgenie.com/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSAppleScript and script editor
      • From: Dominik Wagner <email@hidden>
  • Prev by Date: Re: Character value of 'Enter' and 'Return' Key ?
  • Next by Date: Re: NSAppleScript and script editor
  • Previous by thread: CORE DATA, mutableSetValueForKey: on transient properties returns nil ?
  • Next by thread: Re: NSAppleScript and script editor
  • Index(es):
    • Date
    • Thread