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

Re: NSAppleScript and script editor


  • Subject: Re: NSAppleScript and script editor
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 29 Mar 2006 16:10:19 +0100

Hmm, I would suggest trying:

return ((path to resource "InfoPlist.strings) as text

I've always used return and never had a problem.

Mike.

On 29 Mar 2006, at 14:21PM, Dominik Wagner wrote:

Follow Up:
i filed this under rdar://4494850

It is a bug that only happens on intel, it even works when run under rosetta.
nevertheless - thanks for listening :)


dom


On 29.03.2006, at 14:36, Dominik Wagner wrote:

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/

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


This email sent to email@hidden

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

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


This email sent to email@hidden

_______________________________________________ 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
References: 
 >NSAppleScript and script editor (From: Dominik Wagner <email@hidden>)
 >Re: NSAppleScript and script editor (From: Dominik Wagner <email@hidden>)

  • Prev by Date: Bug in CoreData w/ @count?
  • Next by Date: Re: Bug in CoreData w/ @count?
  • Previous by thread: Re: NSAppleScript and script editor
  • Next by thread: Call back from C++ code.
  • Index(es):
    • Date
    • Thread