Re: NSAppleScript and script editor
Re: NSAppleScript and script editor
- Subject: Re: NSAppleScript and script editor
- From: Mike Abdullah <email@hidden>
- Date: Thu, 18 May 2006 09:55:23 +0100
What happens if you try rephrasing it. AppleScript can be funny
about that sort of thing sometimes. Maybe try something like:
tell application "Address Book" to return (path to resource
"InfoPlist.strings") as string
Also, how come you are doing this by applescript? What it not be
more straightforward by using NSWorkspace and NSBundle?
Mike.
On 17 May 2006, at 16:44PM, Dominik Wagner wrote:
Follow Up:
Either the last security update broke things again or the last
security update reintroduced the problem. Fact is that my sample
code throws the error again on intel in Build 8I1119
Best,
Dominik
On 29.03.2006, at 15:21, 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/
--
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