Hi Matthew,

It is possible, but it requires either extra libraries or
understanding apple events to some extent.

An easier way to go, if you can require 10.5, is to use the Scripting
Bridge instead of NSAppleScript.
<http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/index.html>

If you don't want to require 10.5, there are a number of 3rd party
chunks of code that can help you out.  I have one:
<http://homepage.mac.com/kenferry/software.html#KFAppleScript>.

Using that, you write code that looks like this:

[iTunesControllerScpt executeHandler:@"num_albums_by_artists"
                                      withParameters:@"Artist1",
@"Artist2", nil];

-Ken

On Wed, Jun 4, 2008 at 4:09 AM, Matthew Delves <[EMAIL PROTECTED]> wrote:
> Greetings and salutations,
> Is there a way to pass arguments into an AppleScript file using
> NSAppleScript and other cocoa/obj-c classes?
>
> The reason that I ask is I am wanting to find out the path to a song in
> iTunes. I have a script which does this for hard coded values, though am
> uncertain as to how to accomplish it (or if it is indeed possible) using
> NSAppleScript.
>
> Thanks,
> Matthew Delves
> _______________________________________________
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to