AppleScript Integration
AppleScript Integration
- Subject: AppleScript Integration
- From: Darwin Zins <email@hidden>
- Date: Sat, 22 Nov 2003 10:40:58 -0600
What I would like to do from within my Objective-C Cocoa application is
call an AppleScript that reads all the ToDo information from iCal and
then get that information in to an Objective-C Dictionary. The first
part of that is to actually figure out how to run an AppleScript from
Objective-C. I have this code:
NSAppleScript * exportToDo;
exportToDo = [[NSAppleScript alloc] initWithSource:
@"exportToDo.scpt"];
[exportToDo executeAndReturnError:nil];
This doesn't work though. Do I need to have the path to the
AppleScript? How do I get the path? I added a new AppleScript build
phase and in the bundle the relative path to the script is
Contents/Resources/Scripts/exportToDo.scpt. What I was reading on the
web says this:
To call an applescript in your bundle, get the bundle location and
append @"/Contents/Scripts/applescriptnamehere.scpt". This will give
you your compiled applescript.
How do I get the bundle location?
Once I get my application to call the AppleScript what is the best way
to get the information back to Objective-C? Should I write the
information out to a file in AppleScript that I can read back in with
Objective-C or is there a better way to directly transfer the
information?
Any help is greatly appreciated,
Thank you,
Darwin
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.