• 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
AppleScript Integration
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Reading from an NSInputStream
  • Next by Date: Re: Reading from an NSInputStream
  • Previous by thread: Re: Reading from an NSInputStream
  • Next by thread: Re: AppleScript Integration
  • Index(es):
    • Date
    • Thread