Hot answers tagged

6

There is a feature in the Applescript editor called the Library. it can be accessed through Window > Library on the top navbar, or with the shortcut Shift+Command+L. You can double click on the applications there, and you will see all functions, variables, etc. The windows looks like this. Double clicking shows a new window with all possible functions, ...


3

You could write a folder action script which would parse your downloaded files metadata and move them into folders based on kMDItemWhereFroms metadata attribute value. Or just use Downloads Router Chrome Extension with predefined location rules.


3

This AppleScript ask you to choose some files, after that, it set the comment of each file to the file name. set input to choose file with prompt "Select files (to put the file name into the Spotlight Comment)" with multiple selections allowed tell application "Finder" repeat with i in input tell item i to try set tName to (get name) ...


2

You can do this with an AppleScript. Use the Script Editor in the Utilities folder. Here is a script I wrote for you just now. It works on one folder at a time-- not the top level folder, but the one in your example that is 3587915. When you run this script it asks you to choose a folder. In this example you would open 3587915 and then click "Choose." Very ...


2

A way to do it with Chrome's built in scripting: tell application "Google Chrome" to set URL of active tab of window 1 to "http://example.com" And to expand your script to press return: tell application "Google Chrome" tell application "System Events" tell application process "Google Chrome" set (text field 1 of toolbar 1 of ...


2

To not get that error, you need to make myShellScript.sh executable. In a Terminal, use the following command: chmod u+x /path/to/file/myShellScript.sh Also, you should add a shebang to the top of the script. Example: #!/bin/bash Note: Use the appropriate shebang for the shell you want to process your script. If you do not want to make the script ...


1

You can embed your shell script within AppleScript calling bash with a heredoc. do shell script "/bin/bash -s <<'EOF' cd /Users/myusername/Git/myproject/ /usr/bin/git remote remove orig EOF"


1

open folder then run script tell application "Finder" to set cwd to POSIX path of (insertion location as alias) tell application "VLC" OpenURL "file://" & cwd & "" play end tell


1

You appear to be using git as a file system back-up. Have you considered git-annex? Learning git git can be tricky to learn and debug. Consider mastering the steps you want via Terminal.app – with the help of the Git Book. BitBucket support provides a wealth of examples and workflows to try and to learn from. Once you trust that process, automating via ...


1

For a single script, it is no possible to create a unique icon that's sits near the clock such as the wifi icon for example. There may be unique AppleScript plugins that enable this, but I'm not aware of any. If you need one icon from which you can run a bunch of different scripts, there are tools like FastScripts that enable this. OS X also enables ...


1

I know two products that do near the same thing as you want: Hazel (14-Day Trial): You can write rules to do actions when events are occurred. SafariStand (Open Source): If you use OS X older that 10.11 it can be used. Although you can install SafariStand only on Safari and it organized downloaded files according to the date of download. You can use the ...


1

Open Automator and create a new service: Choose: Service receives selected text in Safari like in the screenshot below. Then add an item Run AppleScript with the content: on run {input} -- create folder from text display dialog " —Create folder from chosen text— This AppleScript will create a folder from text you specify." set destination to ...


1

Using the file pathname from your question, here is the AppleScript code that should work. tell application "Finder" set fileName to name of (POSIX file "/Users/mainuser/Desktop/Test/shot.png" as alias) display dialog fileName end tell A more direct way of the above scenario is: Syntax: set fileName to name of (info for "/path/to/file") display ...


1

To programmatically add a Desktop in Mission Control the code below can be used as an AppleScript or a BASH Script in conjunction with an Automator Service using Run AppleScript or Run Shell Script, respectively, and a key sequence assigned to the Service in System Preferences in Keyboard Shortcuts. AppleScript Code: do shell script "open -a 'Mission ...


1

Basically you can use do shell script "cd my-directory && git init" do shell script "cd my-directory && git add README.md" ...



Only top voted, non community-wiki answers of a minimum length are eligible