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
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
1answer
118 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
538 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
2answers
411 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
93 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
1answer
222 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
277 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
220 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
489 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
1answer
264 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
896 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
908 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
1k views

Allow application to control computer (assistive devices) on Mavericks via Terminal?

I'm currently working on automated instalation of Mavericks 10.9. I have NetBoot set up. Everything works OK untill I want to execute Applescript. Since the release of new version I need to manually ...
2
votes
2answers
675 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
5answers
6k views

How can I write a script to open multiple terminal tabs and execute code in them?

I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
2
votes
1answer
671 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
193 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
237 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
98 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
350 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
3answers
3k 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
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
4k views

When MouseKeys are on, how do I click or move the mouse using AppleScript?

This post suggests that the command tell application “System Events” to key code 37 in AppleScript should move the mouse pointer one pixel down and to the left if run when MouseKeys are enabled. In OS ...
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
876 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
1answer
127 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
48 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
44 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
51 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
122 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
117 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
422 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
485 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
286 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
119 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
927 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
201 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
262 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
2answers
2k views

Applescript click automation in Google Chrome browser?

Hello fellow programmers! I would like to save some applescript code as an application, so that when I open the application it will go to Google Chrome and answer an incoming call in Google Voice. I ...
2
votes
3answers
474 views

How can I see how long my computer has been active (as in not idle)

I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
2
votes
1answer
458 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
424 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
913 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
335 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: ...