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

Re: Retrieving data returned by AppleScript [Solved]


  • Subject: Re: Retrieving data returned by AppleScript [Solved]
  • From: Eric Morand <email@hidden>
  • Date: Tue, 27 Dec 2005 16:35:05 +0100

After a lot of searches on the web, I finally found this :


http://www.cocoabuilder.com/archive/message/cocoa/2003/8/18/89025


It works pertfectly.


Eric.

Le 27 déc. 05 à 15:56, Eric Morand a écrit :

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

=============================================
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
References: 
 >Retrieving data returned by AppleScript (From: Eric Morand <email@hidden>)

  • Prev by Date: Retrieving data returned by AppleScript
  • Next by Date: Re: Problems with large files
  • Previous by thread: Retrieving data returned by AppleScript
  • Next by thread: Re: Retrieving data returned by AppleScript
  • Index(es):
    • Date
    • Thread