• 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
Retrieving data returned by AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Retrieving data returned by AppleScript


  • Subject: Retrieving data returned by AppleScript
  • From: Eric Morand <email@hidden>
  • Date: Tue, 27 Dec 2005 15:56:41 +0100

Hi List !

I'm currently trying to call an applescript from a COCOA code and am having problems to retrieve the data returned by the script.

Here is the script (named getEncoder.scpt) :

tell application "iTunes"
set availableEncoders to (format of every encoder)
display dialog "It Works !!!"
return availableEncoders
end tell


And here is the code I use to execute it :

NSString *appleScriptPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"getEncoders" ofType:@"scpt"];
NSURL *url = [NSURL fileURLWithPath:appleScriptPath];
NSDictionary *theDict = [[[NSDictionary alloc] init] autorelease];
NSAppleScript *theScript;
NSAppleEventDescriptor *desc;
theScript = [[[NSAppleScript alloc] initWithContentsOfURL:url error:&theDict] autorelease];
desc = [theScript executeAndReturnError:&theDict];

NSArray * avalaibleEncoders = [desc data];


The script is executed correctly (the "It Works" dialog appears) but I'm unable to retrieve the data sent by the script (availableEcoders remains empty).



Thanks,


Eric.




------------------------------------------------------------------------ --------
Automator Ketchup : http://automatorketchup.blogspot.com/



_______________________________________________
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
  • Follow-Ups:
    • Re: Retrieving data returned by AppleScript [Solved]
      • From: Eric Morand <email@hidden>
  • Prev by Date: Re: Global variables?
  • Next by Date: Re: Retrieving data returned by AppleScript [Solved]
  • Previous by thread: Re: Prevent running in Rosetta
  • Next by thread: Re: Retrieving data returned by AppleScript [Solved]
  • Index(es):
    • Date
    • Thread