mort
mort

Reputation: 790

Run bash files in Cocoa Applescript (ApplScriptObjC) (Xcode)

I'm trying to make a program consisting of an AppleScript interfacing with bash files (so that I get the fancy Cocoa GUI). I assume this is a simple task, because one of the file types in the new file-menu (cmd+n) is shell scripts (.sh).

I've done a few half-assed tries to get it working (do shell script "sh file.sh"), but I can't figure out how to run those files.

Are there any gurus out there who can help me? :3

If anything is unclear, feel free to ask questions.

Upvotes: 0

Views: 402

Answers (1)

Michele Percich
Michele Percich

Reputation: 1892

If you just want to launch shell scripts from the Cocoa gui, you don't need the AppleScriptObjC bridge, make a Cocoa program in Objective-C and use the NSTask class: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTask_Class/Reference/Reference.html.

Upvotes: 1

Related Questions