views:

127

answers:

2

OK, this feels like an idiot question, but I'm stuck - I don't know the first thing about AppleScript. I have a .scpt file and I want to double-click it and just have it run, but instead every time I click, it opens up the AppleScript Editor. This feels like it should just be an option on the file, but I'm missing something obvious.

Please help me feel less dumb, thank you.

+2  A: 

When you "Save As…", there'll be a "File Format:" dropdown underneath the file browser. To get a double-clickable application instead of a document, choose either "Application" or "Application Bundle"; if I recall correctly, the former is just one file, the latter is a .app bundle like most Mac applications (the bundle will also let you package other resources with your script if you need to). You can choose "Run Only" or not; if you do, you won't be able to edit your script further. (But if you're saving a copy as the application, that might be what you want.)

Antal S-Z
Thanks - this worked perfectly. I appreciate everybody's suggestions.
scottru
A: 

There's more than one way to do it; i have found this to be the simplest:

In sum, you create an Automator application and place your applescript inside it (easier than it sounds, and it's not a hack either--there's actually a specific Automator action for this). Then when you are finished, you select "File" from the menubar, next "Save As Application", then select a location. Now check there and you'll see the newly-created Automator icon (little white robot holding a grenade launcher).

You can do anything that you would ordinarily do with this application icon--double click to open, drag it to your dock, etc.

Appstorm has created an excellent step-by-step tutorial for building an applescript-embedded automator action. On the page i linked to, the tutorial author has also supplied an Automator script that you can download and use as a template.

doug
How is that simpler? "Open + Save as" versus "Create new Automator app + add new action + open script in script editor + copy + paste script in Automator + Save As". The only advantage of this method I can see is if you want it to appear in the Automator contextual menu in Finder, and if you do want to do that you have to add "Save As a Finder Plug-in" to the process.
stib
Agreed. I don't think that could get any more convoluted. Automator is completely ancillary to the original question (and the correctly accepted answer),
Philip Regan