Questions tagged [applescript]
AppleScript is the Mac OS scripting language.
33
questions
36
votes
4
answers
53k
views
Assign a shortcut to running a script in OS X
Does OS X provide an easy way to bind key combinations to commands which are typically run on the command line?
For example, is there some way to assign ⌘ Cmd+L as a global shortcut to quickly lock ...
8
votes
1
answer
22k
views
How to zip multiple files into separate archives?
I admit this question was asked here before:
Like Zip into separate files where the person who asked didn't specify the OS he used and received no answers.
I need to separate a huge directory into ...
19
votes
4
answers
21k
views
How do I set up an AppleScript to open a new iTerm2 tab and change the directory?
In OS X, how do I set up an AppleScript to
open a new iTerm2 tab
change to a directory
clear the console
echo the current directory
I had something like this before for regular Terminal, but I can'...
1
vote
3
answers
3k
views
How to bring application to front every 15 minutes on Mac OS X Lion?
I have a free or cheap little app called Desktop Task Timer LE that I've been using to track my time as I work on various projects. I'd like to have it pop up as the foreground app every 15 minutes to ...
10
votes
3
answers
33k
views
How do I automate clicking a button in an application's window with AppleScript?
Let's say I want to click a button that appears somewhere within a window, using AppleScript. click button works, but you have to know which button exactly you want to press.
For example: Scanning is ...
4
votes
4
answers
11k
views
Automatic PDF renaming based on title
I have thousands of scientific PDFs that i need to rename, many do not have metadata. I would like to be able to create an automator action that could open a folder then open each PDF, copy the title ...
4
votes
1
answer
7k
views
How to open a new Firefox window with URL argument
I am trying to upgrade the existing answer
How to open a new Firefox window with Terminal
to accept a URL as an argument and open a NEW Firefox window.
I can use
open -a Firefox 'http://localhost:...
0
votes
1
answer
2k
views
Change Mac "Ask for password after screensaver" delay
How can I change my Mac OS X Snow Leopard "Ask for password after screensaver" delay?
I've tried:
defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 3600
but won't work. I ...
0
votes
2
answers
1k
views
Apple Script - Reopen Closed Finder Windows
I have the following Applescript which toggles the show/hide hidden files and I would like to reopen the user's Finder windows which will be closed as the Finder gets relaunched.
tell application "...
28
votes
6
answers
37k
views
How to find my stolen Macbook
A friend of mine just had her Macbook stolen. Her Dropbox account is still working on the Macbook, so she can see each time the Macbook comes online, and she can get its IP address.
She has given ...
19
votes
4
answers
25k
views
Applescript to open a NEW terminal window in current space
Yes, I'm having a terrible newbie experience with Apple Script.
I need to open a new Terminal window in the current desktop space. NOT move me to another space which has a Terminal running and then ...
11
votes
6
answers
11k
views
How do you duplicate current open Finder view in new tab (Mavericks)?
In a thread on this forum there is an interesting solution on how to open a duplicate of an already open Finder window with the help of an AppleScript:
How do you duplicate current open Finder view?
...
9
votes
3
answers
15k
views
Mac OS: How can I launch the iTerm terminal, with a specific profile, from Automator or AppleScript?
I'm trying to assign a global keyboard shortcut that will launch a new window of iTerm, with a specific profile. (I managed to do this to launch a new Chrome window with Automator and AppleScript, but ...
9
votes
4
answers
14k
views
Switch between Google Chrome Tabs using AppleScript
I was hoping that the following code would do the job, but no cigar:
--Only the window is brought into focus
tell application "Google Chrome"
activate tab 1 of window 1
end tell
7
votes
1
answer
8k
views
Get the media buttons on my bluetooth headset working with Spotify on OS X
I just bought a Parrot Zik, which is a pair of bluetooth headphones with volume control, play/pause and next-prev buttons. (Or gestures, as they come with the Zik).
The phones work beautifully with ...
6
votes
2
answers
1k
views
How do I make Mail.app quit after iCal sends an alert?
iCal uses a built in script file to email reminders through Mail.app. It works great, but I don't use Mail.app for my main email account, just for sending calendar notifications.
So, Mail.app opens ...
6
votes
1
answer
5k
views
How can I run a script whenever I plug in an external monitor? [duplicate]
Possible Duplicate:
Reset Mac OS X Windows Position after de-attaching external monitor
I use my laptop at work, where I have a second monitor, and at home, where I don't. When I plug in the ...
4
votes
4
answers
6k
views
How to open a new Firefox window with Terminal
I am running Firefox v10.0.1 with OS X Lion v10.7.3
From the Apple dock, you can right-click on Firefox icon and choose NEW and a new Firefox window will open.
From terminal, I have tried
open -...
4
votes
5
answers
8k
views
Applescript to lock the screen
I need a little Applescript to lock the screen, the same behaviour I get when I click the Keychain icon in the menu bar and choose "Lock screen".
I found a way to activate the screensaver, but it's ...
3
votes
1
answer
2k
views
How can I run an AppleScript or shell command on Mac OS X at screen unlock?
Note that this is not the same as startup or login. I never log out of my machine and I want to run the script whenever I unlock the machine to start working.
3
votes
2
answers
7k
views
How do I target and close a specific Terminal window in AppleScript?
Background
Given the below terminal script, I want to modify the osascript so that instead of targeting the front window I am targeting the specific window that is opened from the AppleScript.
...
2
votes
1
answer
3k
views
Get path of open file in any application on Mac OS X?
I installed Afloat for Mac OS X and I really like that it has a shortcut to "Reveal Current File in Finder". This works for basically all applications written in Cocoa.
Can I use something like that, ...
2
votes
2
answers
6k
views
How can I run an applescript from my Mac with a shortcut (without using 3rd party apps)?
Hi I have an applescript that sends Outlook emails to Omnifocus - and it works when I run it manually, by clicking on and running the script.
Is there any way to do this with a shortcut without ...
1
vote
2
answers
2k
views
Open Terminal with predefined tabs
Is there any way to open Terminal with predefined tabs?
I have 5 most common paths that I usually use and I want Terminal to open with these paths opened in different Tabs.
I guess this should be ...
1
vote
1
answer
3k
views
Pass arguments to osascript via shell function in OS X Mountain Lion
The answer in How to open a new Firefox window with URL argument is broken in Mac OSX Mountain Lion (10.8.2). I can't comment on that answer or question, so I had to create a new question.
It fails ...
1
vote
2
answers
5k
views
Get path of sub-folder's Parent : Applescript
I want to get the path of a subfolder's parent folder when I drop a folder on a application coded in Applescript
So if I drop a folder called 'Test1' which is on the Desktop
I want the script to ...
1
vote
2
answers
5k
views
How to I use Apple Script to change the keyboard layout on Snow Leopard? [duplicate]
Possible Duplicate:
Switch TO specific input source
I want to do something like:
set keyboard layout to 'QWERTY' or something like that.
1
vote
1
answer
157
views
Is it possible to set a Custom quick look preview image in OS X?
Is there any way to set a custom quick look image in OS X?
I'd like a command line tool or applescript to change or embed a custom preview for a zip file using a jpeg.
0
votes
1
answer
384
views
Using AppleScript to Enable Snow Leopard's Text Replacement Feature
I currently use Quicksilver with a Plugin and Trigger in concert with Snow Leopard's text replacement feature (for frequently-used combinations of hashtags, due dates and other parameters) to quickly ...
0
votes
2
answers
3k
views
AppleScript and Preview.app
I saw this post:
How do I get applescript to work with Preview in Snow Leopard?
In my attempt to figure out how to use AppleScript with Preview. I'm trying to automate a series of tasks that will ...
0
votes
1
answer
2k
views
How do I get applescript to work with Preview in Snow Leopard?
How do I get applescript to work with Preview in Snow Leopard? I'd like, for instance, my applescript for resizing a window to full screen (which works for most applications (e.g., chrome)) to work ...
0
votes
1
answer
1k
views
How to run a shell script from an AppleScript?
I am using a Mac running OSX Yosemite v.10.10.5.
When I try to run my shell script from my AppleScript, I get the following error message:
Error message at AppleScript Script Editor
error "sh: /...
0
votes
1
answer
2k
views
Automate subject in Apple's Mail.app
At the company I work with, we use [client-domain.com] prefixes before the actual subject line of emails as kind of a rough tagging system.
Is there any way that one could automate this so when I ...