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

learn more… | top users | synonyms (2)

3
votes
1answer
547 views

How can I get my AppleScript code to move files?

Having used Automator to organise files by file extension successfully before, I decided to create an AppleScript application that will save me having to change parameters manually, as Automator ...
3
votes
1answer
87 views

Tell application screen is not zoomed

When using OS X's native zoom, is there any way (perhaps using AppleScript) to fool an application into thinking the screen is not being zoomed? Something like tell application "System Events" to ...
3
votes
2answers
173 views

Unaccent Special characters and bulk-rename

Background I have a workflow that collects documents from various sources, converts them to PDF, OCRs them, compresses them, extracts their contents and annotations, uploads the files to a server and ...
3
votes
1answer
78 views

Log software usage time on Mac OS 9 (Oct. 1999)

I'm needing to log the time a user spends inside of an application in Mac OS 9. I created a simple bash script "launcher" to do this, but then discovered OS 9 doesn't have bash installed. Here is the ...
3
votes
2answers
696 views

Can AppleScript be used to downloading files from a web page?

I want to write a script that searches a web page for an updated file, then downloading it when detected. There is no command I have found that does this, accept Automator's download URL function, ...
3
votes
1answer
119 views

Running an AS droplet from Terminal

I have an Applescript Droplet application that I need to run from terminal. I can use osascript or even just open to open the AS App, but that will run its on run handler, not the on open droplet ...
3
votes
1answer
817 views

System-Preferences Applescript using osascript cannot select its window

This AppleScript (based on an answer in a MacWorld form) will tell me whether or not Screen Sharing is enabled: tell application "System Preferences" reveal pane "com.apple.preferences.sharing" ...
3
votes
1answer
371 views

Applescript - Connection is invalid

I have an application for mac and I use the following applescript code (exported as an AS app) to start that app periodically: on idle tell application "System Events" tell application ...
3
votes
1answer
565 views

Can I send Notification Center items to my iPhone using Pushover or Prowl?

The title pretty much sums it up. I often feel like having notifications on my iPhone are a lot easier to notice, especially if you step away from the computer for a few moments to do something and ...
3
votes
1answer
2k views

How to avoid the GUI password prompt when using `osascript`?

I’d like to use the osascript shell command to run some AppleScript, but I’d rather avoid the GUI password prompt. Instead, I’d prefer to run the script as sudo from the command-line, so no GUI ...
3
votes
1answer
483 views

How to Unset iTunes Track Start And Stop Time For Multiple Tracks?

For some reason a lot of tracks in my iTunes library have senseless start and stop times set. This is really annoying as some tracks get skipped after a few seconds. There are Apple Script commands ...
3
votes
1answer
655 views

How can I generate dynamic keynote presentations?

I'd like to build a series of Keynote presentations that contain some dynamic elements. By that I mean some elements are "compiled" in later. For example if I have a code sample on a slide, I want to ...
3
votes
3answers
1k views

Show text using Large Type without relying on third-party applications

Apple has this amazing feature called 'Large Type', chiefly implemented into Address Book. When you look up a contact, you can right-click the phone number and click 'Large Type', and it will display ...
3
votes
3answers
613 views

Mavericks - Tell application “Preview” open PDF - strange permission issue

I have recently moved a large research collection of PDF files, from a Snow Leopard 10.6.8 TimeMachine disk, to my new rMBP (to the internal flash storage). I did this manually, not through the ...
3
votes
1answer
832 views

enabling/disabling internet sharing with terminal in mac osx 10.9.2

Very much on the line of already existing questions, but not having enough reputation to comment by following existing threads, I can only ask my own, at the risk of duplicating may be, certainly ...
3
votes
1answer
125 views

AppleScript Editor : comment line shortcut?

Is there a keyboard shortcut to comment lines in AppleScript Editor ? The common Cmd+shift+/ does not work here.
3
votes
2answers
214 views

AppleScript : do a mouse scroll on a Finder window

How can I do a mouse scroll on a Finder window in AppleScript ? I know there is keystroke for the keyboard, click for a mouse click, but is there something for the mouse wheel ?
3
votes
1answer
254 views

How do I use screencapture for capturing floating windows?

I am trying to automate the periodic capture of a floating window. Specifically, of the floating 'Current Call' window which is used by Skype when the main window is off-screen. By googling, I found ...
3
votes
2answers
308 views

Alfred extension or equivalent that brings a single window to the forefront

Right now, if I want to switch to a Sublime Text 2 window open to a "project" called foo, I can do option+space, type Sub hit enter and then hit cmd+` repeatedly until I arrive at the window I want. ...
3
votes
1answer
241 views

Is it possible to launch a Linux application running under Parallels from OS X?

I am looking for a way to launch an individual application (e.g. Firefox) on my Ubuntu installation which is running under Parallels. I am open to any method of launching such as a shortcut (like how ...
3
votes
1answer
552 views

Hide windows in current desktop (Lion)

I'd like to make a keyboard shortcut that hides all windows on the current desktop, while ignoring windows on other desktops. Is this possible using Applescript?
3
votes
0answers
260 views

Applescript vs. Spaces in Lion (10.7)

In Snow Leopard (10.6), I had an applescript that toggled iTunes between "maximised on Space 2" and "mini-player on all spaces": set app_identifier to do shell script "echo 'com.apple.iTunes' | ...
3
votes
1answer
279 views

AppleScript/Automator Workflow to restore OS X to “mint” condition

Under Mountain Lion, I wanted to create an AppleScript that would essentially restore my OS X install to "mint" condition, if possible even to the point of showing you the ML welcome screen asking you ...
2
votes
4answers
969 views

cron is failing to run my AppleScript

I have the following code in a text file (myfile.applescript): #! /usr/bin/osascript tell application "Google Chrome" to quit I would like Chrome to shut down each night at 9:15PM, so I added the ...
2
votes
1answer
2k views

Script that outputs number of emails in Mail.app inbox

I'd like to have a command-line script I can invoke at the Terminal that will output the total number of messages in my "Work" Inbox in mail.app. Usage would look like this: $ inbox-count 48 What ...
2
votes
3answers
987 views

Check if a process is running, if not execute it again in Terminal

Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal? I have a PHP script that is needs ...
2
votes
2answers
865 views

Problem with empty spaces when executing shell commands in AppleScript

The following code to purge a directory recursively does not work because I cannot get past the Application Support folder. try do shell script "rm -r ~/Library/Application\ ...
2
votes
3answers
4k views

/bin/sh: rm: command not found

I have problems with some applications that use AppleScript shell script feature. For example, Growl's uninstall scripts shows an error: error "/bin/sh: rm: command not found" number 127 The source ...
2
votes
1answer
704 views

How can I automate changing the quality of several photos?

I would like to be able to reduce the quality of the photos I have in a directory through some sort of automation. One of the requirements is that I cannot change the dimensions of the photo. The ...
2
votes
2answers
269 views

Terminal.app equivalent of `xterm -e 'cmd'`

With xterm (and gnome-terminal, terminator, etc), you can run the following command: $ xterm -e 'vim somefile.txt' xterm will open and run the specified program (in this case, Vim). When the ...
2
votes
3answers
286 views

Sort Finder columns reversed

I can't get this reversed thing to work: Tell application "Finder" to set the sort direction of the modification date column to reversed
2
votes
2answers
1k views

AppleScript “Kill” Command Error

I am attempting to run an AppleScript every 24 hours to close a running application and restart it. I have used the following code successfully with other Apps: repeat delay 84600 set app_name ...
2
votes
2answers
2k views

Automatically press a key every 60 seconds

Is it possible via Automator, an app, applescript, etc. to automatically press a key (i.e. "g") every 60 seconds?
2
votes
1answer
255 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
139 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
575 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
1k 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
152 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
3answers
4k views

How do I create an AppleScript that will quit an application at a specific time and then put the computer to sleep?

I've been toying around with AppleScript and Automator to get this thing to work, but I just can't seem wrap my head around it. If anyone could show me an example or give me some tips on how I can set ...
2
votes
2answers
677 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
1k 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
2answers
2k views

Osascript error

I was messing around with some external libraries, and for some reason when I enter any Osascript command, I now get this error (before it did work): 2011-09-07 19:13:43.306 osascript[1083:707] ...
2
votes
1answer
702 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
911 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
4answers
81 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
112 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
322 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
66 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
55 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
66 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 ...