Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Terminal Commands
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mac57" data-source="post: 598117" data-attributes="member: 17052"><p>OK folks, I have it... an AppleScript script that will do the above. It turns out to be VERY easy. Here it is:</p><p></p><p>[CODE]do shell script "/Users/mac57/bin/any-bash-command"</p><p>[/CODE]</p><p>That is the whole thing! Where I show "any-bash-command", you can substitute any command that bash can execute from Terminal.app, including bash scripts. So, this is pretty general purpose for the nature of the question at hand.</p><p></p><p>To run this, open the AppleScript editor (Applications/AppleScript/Script Editor.app) and type that line in. Save the result out to your desktop, or somewhere convenient. While still in the script editor, use the Run button to test your script to be sure it is doing what you want. </p><p></p><p>Now to make life simple, so that you don't have to open the Applescript Editor every time you want to run your script, open the AppleScript utility itself (same place as editor is) and check the check box for "Show Script Menu in menu bar". A little scroll-like symbol will appear on your menu bar. I call this the "Scroll icon" from now on. Click it and select "Open Scripts Folder". This opens a Finder window on your scripts folder. Place your new AppleScript script in there and it magically now appears as part of the drop down menu you get when you click the Scroll icon. You can now run your script by simply selecting its name from the Scroll icon on your Menu bar. </p><p></p><p>Done!</p></blockquote><p></p>
[QUOTE="mac57, post: 598117, member: 17052"] OK folks, I have it... an AppleScript script that will do the above. It turns out to be VERY easy. Here it is: [CODE]do shell script "/Users/mac57/bin/any-bash-command" [/CODE] That is the whole thing! Where I show "any-bash-command", you can substitute any command that bash can execute from Terminal.app, including bash scripts. So, this is pretty general purpose for the nature of the question at hand. To run this, open the AppleScript editor (Applications/AppleScript/Script Editor.app) and type that line in. Save the result out to your desktop, or somewhere convenient. While still in the script editor, use the Run button to test your script to be sure it is doing what you want. Now to make life simple, so that you don't have to open the Applescript Editor every time you want to run your script, open the AppleScript utility itself (same place as editor is) and check the check box for "Show Script Menu in menu bar". A little scroll-like symbol will appear on your menu bar. I call this the "Scroll icon" from now on. Click it and select "Open Scripts Folder". This opens a Finder window on your scripts folder. Place your new AppleScript script in there and it magically now appears as part of the drop down menu you get when you click the Scroll icon. You can now run your script by simply selecting its name from the Scroll icon on your Menu bar. Done! [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Terminal Commands
Top