AppleScript is a proprietary programming language in Mac OS X to control and exchange data with applications.

learn more… | top users | synonyms (2)

2
votes
1answer
257 views

Undocumented applescript functions

Is it possible for an application to have undocumented applescript functions. Commands that do not appear in the Applescript Editor Library for the application? Is this common? Is there someway to ...
2
votes
2answers
184 views

How to reset OS X volume after sleep using launchd?

I'm been trying to write a plist file on which when I return from sleep mode, I always want to make my Mac volume to the minimum amount. However, it looks like the following plist doesn't work, with ...
2
votes
5answers
709 views

Set Services keyboard shortcut via script OSX

I need a way to set the following programmatically: Specifically for shortcuts under Services, if that makes a difference. I'm wondering if this is possible via shell or AppleScript? EDIT: I've ...
2
votes
2answers
2k views

automator to run AppleScript for a shell script

For a selected file in Finder, I like to run a perl script using Services. I created an Automator process that runs an AppleScript: on run {input, parameters} tell application "Terminal" ...
2
votes
1answer
190 views

Trying to remove files listed in file with AppleScript with do shell script call

The following code is an example of what I'm using at the moment, but it keeps erroring out on me: do shell script "find /Applications -name 'Bingo.app' > /tmp/remove_files" with administrator ...
2
votes
2answers
1k views

Applescript Click “Go” and “Open” - dialog inside application

In PCSX, (ps1 emulator), I'm trying to automate the steps to play an ISO. So, I'm doing this: set thepath to path to me set thesecondpath to POSIX path of thepath set thethirdpath to ...
2
votes
2answers
705 views

Applescript to kill open applications and log out user after 30 min. of inactivity

I'm looking for a way to automatically log off a user after 30 minutes of inactivity, as well as close all open applications. As of now, there is really only one user to deal with. I'd prefer an easy ...
2
votes
2answers
2k views

Creating wrapper script for Mail.app to send mail from Terminal

I'm trying to send mail from terminal with the help of bash and applescript. I use bash for taking care of arguments and the email message body. Then I have tried using Applescript to send the mail ...
2
votes
1answer
752 views

Problem setting terminal window bounds with AppleScript

Problem trying to solve I use multiple terminal windows to develop web applications. I'll have a terminal open for vim, a terminal open for git and a terminal open for basic file/directory commands. ...
2
votes
1answer
978 views

applescript (osascript) for changing Terminal.app profile

Is here a way to changing the Terminal.app profile from the command line? Here is already couple of questions about changing colors, but I need change the whole profile from the "Basic" (what is my ...
2
votes
3answers
98 views

Toggling wi-fi on and off

I need an applescript that will toggle wi-fi off and on at set intervals, say every 10 or 15 minutes. I'm using a 2012 MacBookPro running 10.9.5.
2
votes
1answer
188 views

Moving finder window from one display to another

Would it be possible to create an AppleScript to instantly drag one screen from one screen to another (say, center of the second screen)?
2
votes
1answer
685 views

AppleScript/Automate Mail Tasks

I've been trying to help a coworker automate a weekly email compilation he sends out but haven't yet been able to figure out how address a few specific areas...first I'll explain the situation, then ...
2
votes
1answer
85 views

Possible to automate entering star ratings and play counts for identical/duplicate song in iTunes?

I'm in the process of replacing my low quality <192 kpbs MP3s into either 320 kpbs MP3 or ALAC files in iTunes. Right now my routine is to import the new HQ files to iTunes, go to "Show Duplicate ...
2
votes
1answer
57 views

String of variable has a space - how do I escape spaces?

I'm working on an applescript that pulls old Time Machine backups and places them into a new folder. But if the old computer name has a space in it, that causes an issue in the do shell script ...
2
votes
1answer
97 views

Change keyboard whenever iTerm is selected

Using either Applescript or Automator is it possible to switch the software keyboard(Input Source) to a certain keyboard(input source) whenever iTerm becomes foreground? Scenario is as follows I ...
2
votes
2answers
176 views

How can I automate GIF to PNG with Preview using AppleScript?

I have a GIF file but I can open it only with Preview because it is a little bit ruined (GIMP or other programs does not open it correctly but it works with Preview). I want to export it to PNG ...
2
votes
2answers
154 views

How do I link/call an actual shell script saved within an Applescript app?

What's the correct syntax in the Applescript below to make this app run by double clicking on it rather than how it runs now by just running the Applescript in the AS script editor? The Shell script ...
2
votes
3answers
800 views

Applescript for deleting desktop files upon logout

I'm completely new to Applescript and currently very busy at work. I don't have time to learn it, I will once I find some free time, so I decided to ask you, the experts, for help. I need an ...
2
votes
2answers
847 views

How to swap command and option modifier keys with a script in OS X Lion

I use a PC usb keyboard with my macbook. So, I've gone into System Preferences > Keyboard > Modifier Keys... and swapped command and option for the usb keyboard. This puts those keys in the ...
2
votes
3answers
481 views

Automator: Correct syntax for calling an AppleScript file

I'm attempting to write an Automator application that will mount an external disk. I have an AppleScript that does the job and I'm attempting to insert it into an Automator application. However, ...
2
votes
2answers
142 views

Add AppleScripts to Git repository

I have a few AppleScript files that I would like to share with the community on GitHub. The files are located in two distinct directories: ~/Library/Scripts ~/Library/Application ...
2
votes
1answer
2k views

Set size of window to exact pixels, and place via x, y coordinates

I would like to create a tool that allows you to set windows to exact sizes on the pixel scale to be able to have more precise screen divisions. For example, if I had four Terminal windows (and I ...
2
votes
4answers
276 views

How to get screenshot only external monitor?

I there any way to screenshot only external monitor screen? do shell script "screencapture -x " & shot_path
2
votes
3answers
319 views

How can I set up a shell script as a wrapper to the main executable of an app?

I have an application that I want to launch via a shell script that does some setup and then launches the app itself with some specific options. Ideally, this script would be run whenever the ...
2
votes
1answer
504 views

What are some good resources for learning how to AppleScript with Xcode 4.3.2?

I AppleScript quite a bit and I'd like to start working with Xcode 4.3.2, so that I can expand the functionality of the things I'm writing. However, I have no idea how to use Xcode, nor how to ...
2
votes
1answer
466 views

Can you (semi-)automatically rate all songs with at least X plays with Y stars in iTunes?

After reconsolidating my music collection in iTunes, I’m curious if there is any way to programmatically set star ratings based upon the number of plays, but only for songs that I have not yet rated? ...
2
votes
1answer
985 views

How Can I Restart in Windows Using a Script?

I'd like to be able to reboot into the Boot Camp partition without needing to go change the Startup Disk in System Preferences or holding down the Option key at startup. After reading some stuff on ...
2
votes
2answers
3k views

How do I use Applescript with Keynote?

My first Problem: For some reason the Applescript Editor is not able to pick up events when recording from Keynote'09 (I already turned on the acessibility options). The Editor stays blank for all ...
2
votes
1answer
367 views

Force a file to overwrite instead of appending

I've got an application that won't overwrite a file with the same filename. It will only append the filename with a 'space 1'. If I write a file more than once I get something like this: ...
2
votes
2answers
1k views

AppleScript or Automator Workflow for Bulk-Converting Powerpoint Presentations to Keynote

I have a large set of Powerpoint presentations that I would like to convert to Keynote. I can convert each one manually by following these steps: In Finder, right-click Powerpoint document and ...
2
votes
1answer
1k views

How to use the built–in VPN Server on Mac OS 10.6.6

I know that Mac OS 10.6.6 has a built in VPN server that one can access through command line. Is there an easier way? Can I make an Automator or AppleScript program that starts and stops the built–in ...
2
votes
1answer
85 views

AppleScript keystroke ignoring numbers

A very simple AppleScript like this: tell application "System Events" keystroke "abc 123" end tell results in just “abc” being typed. Online resources suggest this should not be the case. ...
2
votes
1answer
42 views

In an AppleScript, how do I call/reuse a subroutine from another AppleScript?

snippet 1a on removeText(searchText, sourceText) set prevTIDs to text item delimiters of AppleScript set text item delimiters of AppleScript to searchText set sourceText to text items of sourceText ...
2
votes
4answers
1k views

How to open a new Terminal tab in current working directory?

I want to create and run a bash function that: cd into a project's directory Open a new tab in Terminal in the same directory Open my dev tools and start dev services Item #2 doesn't work as ...
2
votes
1answer
378 views

Trim filenames in automator w. shell or applescript

Why doesn't this work? (The automator is in swedish but the parts are: get selected finder objects - get folder contents - run shell script) I want to trim the first three characters of the ...
2
votes
1answer
53 views

list box in applescript?

I'm trying to have users pick a department from a list box. And then that choice is stored in a variable as string. How can I do this? I have code written like this: set deptList to {"dept1", ...
2
votes
1answer
959 views

Go to the Running Safari And Press Enter Using AppleScript

I'm very new to AppleScript and I'm trying to do this. I have an Safari process running on my machine. I wish I could go to the running safari and stimulate an enter key event. Is it possible to do ...
2
votes
1answer
1k views

Applescript to copy folder (and contents) to current location?

I am trying to create a button on my Finder toolbar powered by applescript to make a copy of a set folder (e.g. /Users/James/doc) and all files/subfolders within it to the current location in Finder. ...
2
votes
1answer
84 views

Why does “if exists” fail with a false positive?

The file, "Test.file" in the below code does not exist, yet the script returns true. Why? What am I doing wrong? set thePath to (path to application support folder from user domain) if exists ...
2
votes
3answers
177 views

Create hotkey to insert text

I want to create a hotkey command that insert this text "/" in whatever application I'am The reason is because I'm a developer and I use the / symbol a lot, the problem is with my keyboard layout, ...
2
votes
2answers
1k views

Run script before restart/shutdown

Is it possible to execute a script/command right before OS X is shutting down or restarting? I'd like to run sudo apachectl stop to stop apache from auto-starting.
2
votes
1answer
319 views

Check for Existence of File then Move Rename Old File and Move New One

Here is what I am attempting to do: I have a folder which contains a script and a file. The file is an older copy of a file located in this path: ...
2
votes
4answers
1k views

osascript “set bounds of window” not working after Mavericks upgrade

I have a number of bash functions I run at the beginning of each day to start work. They all look pretty much like this: mind() { osascript -e 'tell app "Terminal" do script "ssh -A ...
2
votes
1answer
321 views

How can I change Contacts.app custom labels automatically using AppleScript?

Is there a way to change the current labels in Contacts.app to custom ones using AppleScript based on a specific criteria? Here is what I mean: I need the script to go through my contacts to change ...
2
votes
1answer
451 views

Launch Dictation With Applescript

I would have thought this would be easy to find, but thus far it has not been for me. Is there a way to launch dictation (fn, fn) with applescript or from the terminal?
2
votes
1answer
41 views

How can messages be scripted whenever I open a specific application?

Say I want to start Safari on my Mac. Can I create a pop up message that reads, "Use Chrome instead" or some other thing? I presume it may be possible with Applescript or something, but don't know ...
2
votes
2answers
379 views

Applescript to run when iPhone connects/disconnects

I'm trying to figure out how to run an applescript when I connect and disconnect my iPhone with the USB cable. So far, I think I can run an applescript when it connects by using Image Capture ...
2
votes
1answer
1k views

Automatically forward “Starred in Gmail” messages to OmniFocus

Summary: I would like to create some sort of an automated process where any messages that I 'star' in Gmail (aka 'flag' when using Gmail via IMAP) will automatically be added to OmniFocus, and then ...
2
votes
1answer
1k views

Shortcut to eject all external hard drives but not MobileBackups

So far I've been using the following AppleScript to eject all external drives at once conveniently using a shortcut: tell application "Finder" eject (every disk) end tell This script is is ...