Open an app with command line arguments

Hello all.

So, I’m trying to convert some Cocoa information into ASOC (as usual)

as per I’d like to open an app with arguments and return a value on closing the app

I thought it may be as simple as argc, argv being reserved words but it appears not.

In AS, it would be relatively simple:

    on run argv
      return "hello, " & item 1 of argv & "."
    end run

  % osascript a.scpt world
    hello, world.

But no luck in Xcode :frowning:

If they’re named arguments, you can use NSUserDefaults. But it’s probably easier to use NSProcessInfo:

  set theArgs to current application's NSProcessInfo's processInfo()'s arguments()