Re: NSAppleScript and script editor
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