Tagged Questions

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
212 views

AppleScript SL to ML Issue (compatibility error?)

I've written the following script in Applescript in Snow Leopard, and I tried to use it in Mountain Lion, but to no avail (doesn't work). The script watches a folder for added files, and if the ...
1
vote
2answers
2k views

Change Date Created based on the filename

I've downloaded a bunch of my Instagram images but the Date Created of the files is set to the time that I initiated the download. What I do have though is the Date Created in the filename. What I ...
0
votes
1answer
344 views

Detect the TV Show, Season and Episode from a mp4 file in applescript

Assuming I have an MP4/M4V file of a TV show. The file has the necessary metadata so it can be imported into iTunes and you'll see the all the relevant information. Using AppleScript, one can extract ...
1
vote
1answer
954 views

AppleScript to compare contacts in two groups and remove duplicate from one group

I want to create an AppleScript for Apple's Address Book (Contacts) app that will look at two Groups, and if a contact is in one Group, it will remove it from the other Group. Specifically, I add ...
1
vote
1answer
926 views

Insert images into Pages document using AppleScript

I'm trying to automate the construction of a document, and am looking for a way to insert images into a Pages document with AppleScript. For example: tell application "Pages" make new document ...
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 ...
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 ...
6
votes
1answer
648 views

Toggle Finder sort order with AppleScript under Lion 10.7?

For years I've been using this AppleScript to toggle the sort order of a Finder window: if sort direction of column id size column of list view options of window 1 is normal then set sort ...
0
votes
2answers
436 views

How to get the path of the selected Image in Adobe Bridge via Applescript?

I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this: set ...
6
votes
3answers
2k views

How to disable individual USB ports by script?

I am looking for a script which will allow me to disable one specific USB port on my Mac mini. It would only serve a purpose if it works in real-time and didn't require a reboot. I've found scripts ...
0
votes
2answers
517 views

How can I connect Linux server with Applescript using iTerm or Terminal?

I want to connect and run bash script on Linux server automatically by using Applescript and iTerm or Terminal on OS X. How can I connect Linux server with Applescript use iTerm or Terminal?
0
votes
1answer
462 views

Drag and drop from iPhoto may remove the pictures from iPhoto Library, how to recover it?

I modified the "Recursive Image File Processing Droplet" example provided from Apple in AppleScript Editor to rename any dropped file and move it to a custom folder. It worked seemingly flawlessly ...
9
votes
3answers
9k views

iCal No Longer Runs Scripts?

I have some automated tasks in the form of AppleScripts which I would schedule to run overnight via an iCal event. The event would simply be set to "run script" at "0 minutes before the event" and ...
12
votes
6answers
10k views

How to set screen resolution with a keyboard shortcut on Retina MBP?

I've found myself switching between the 1440x900 and 1920x1200 "effective resolution" setting depending on what I'm doing (need more space on screen, etc). Is there a way to toggle between these two ...
2
votes
1answer
993 views

Why won't my AppleScript run as a Service?

I have a simple AppleScript that works exactly as expected when run on its own, ether as an app, directly from within ScriptDebugger or Script Editor, or as an element of an Automation from within ...
1
vote
1answer
646 views

How do I change some text in an OmniGraffle document via AppleScript without changing the text's styling?

If I create an OmniGraffle document, add a text box with “Test” in red in size 28, I can change the text with this snippet of AppleScript: tell application "OmniGraffle Professional 4" set text ...
0
votes
1answer
103 views

Applescript won't play movie when waking from sleep

I have the following AppleScript, which is triggered by iCal to act as my alarm clock: set musicPath to the path to me as text set musicPath to text items 1 thru -12 of musicPath as text set ...
7
votes
2answers
5k views

How can I bring a window to frontmost without focusing it using Applescript in OS X 10.8

I want to bring a window (QuickTime for example) to frontmost, without focusing it. I can do it in OS X 10.7 using the following code in Applescript. tell application "System Events" set visible ...
0
votes
1answer
954 views

Trying to use applescript to launch cmd line 3 scripts in new tabs

I'm trying to launch 3 tabs and run a script in each with applescript. So far I havent been able to get this done. Currently I have: tell application "Terminal" activate do script "ping ...
1
vote
2answers
2k views

How do i pass variables' values between subsequent applescript runs? (persistent value between script executions)

I have an applescript that I run like a cron job. Within this applescript, i have variables that act like boolean switches (i.e. on/off values). With subsequent runs, depending on whether the boolean ...
5
votes
3answers
5k views

Activating screen saver from AppleScript in Mountain Lion

I had a script that I used to use to activate my screen saver, and it no longer works in Mountain Lion. It was a shell script that called an AppleScript script: #!/bin/bash osascript ...
3
votes
1answer
545 views

Does applescript's 'delay' function work when the computer is asleep?

I'm trying to make an alarm clock for myself with AppleScript after my old (physical) one crapped out. I've got a script that'll schedule a pmset wakeup at the requisite time. There's just the matter ...
73
votes
5answers
32k views

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an ...
1
vote
1answer
361 views

AppleScript to tell Adobe Reader to close a certain document

Adobe Reader has N documents open. One of them has a known filepath and title and it needs to be programmatically closed. How to go about doing this in AppleScript? Specifically, how can I: Talk to ...
0
votes
1answer
157 views

Applescript to monitor terminal changes

I want to be able to check if a word appears in a terminal window running a java application and then display a notification. Any ideas?
2
votes
1answer
397 views

Finder list view, change column with to optimal with using AppleScript

I'm trying to create an AppleScript script that resizes the columns of Finder's list view (e.g. Name, Size …) to their optimal width (i.e. the minimum width where all text in the column is visible) on ...
2
votes
3answers
519 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 ...
1
vote
3answers
716 views

Applescript app to shut down Mathematica at a specific time of day

I have the following workflow that I need to execute on a daily basis for a period of days: The computers start at a specified time, Mathematica and a specific Mathematica notebook launch and ...
2
votes
3answers
669 views

How to add a Safari toolbar button that runs an AppleScript

How do I add a button to the Safari toolbar that, when clicked, executes a given AppleScript?
2
votes
1answer
219 views

Launch Genius via AppleScript

I would like to launch a Genius playlist for the currently playing song in iTunes via an AppleScript. A prerequisite would be for the script to work when iTunes is in full screen. And ideally, it ...
1
vote
1answer
848 views

Deleting all songs in a given iTunes playlist using Applescript

I'm working on a script to manage my "queue" playlist in iTunes and wanted an easy and fast way to quickly delete all songs in that playlist. Applescript seemed the best option and I created a little ...
1
vote
2answers
211 views

Open a folder in default browser

I have many web projects that I develop on the localhost. Normally to get to these one has to navigate from the root directory or bookmark the url. I want to be able to open an OS directory/folder in ...
1
vote
2answers
425 views

Launch Final Cut Pro, make a new project and name it with Automator

I want to make an Automator app that will do a couple of things for me with Final Cut Pro: I want it to ask me to name a the new project (we will call it test1) Then I want it to make a new folder ...
1
vote
2answers
2k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
2
votes
2answers
699 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 ...
0
votes
2answers
396 views

Is there a dial from Addres Book and tel:/sip: protocol handler script/application available for 10.7?

We are currently using Mac OS X 10.6 and snomURLHandler to convert tel: uri's to a http GET request. This computer telephony integration let us click on a telephone number in Address Book.app and let ...
0
votes
1answer
110 views

Toggling page views in Skim

When right-clicking on a document in skim there are two very useful options: Single Page (good for presentations) Single Page Continuous (suitable for reading) Is there a way to define a shortcut ...
3
votes
2answers
481 views

Copy message_id from selected message

In Mail, when I've selected a message, I would like to have a shortcut to copy the message_id (see my previous question) to the clipboard. How do I manage that? Applescript, I presume?
3
votes
2answers
2k views

Any way to trigger Folder Action when adding file to any subfolder?

I've created a Folder Action in Automator and applied it to a folder. But it only gets triggered when a file is added to the root of that folder, not to one of its subfolders. Is there any way to get ...
0
votes
1answer
315 views

AppleScript and Growl: How to choose the display style?

I'm using AppleScript and calling Growl notifications and I notice that it ignores my choice of using Bezel as my system default style. It only changes if I manually change it in Growl's preferences. ...
3
votes
1answer
386 views

Applescript array of applications

I have a script that reload the active tab of an open browser, but I want it to do with all opened browsers. Is there a way to make a list/array and use it in this code? This code works with one ...
2
votes
1answer
309 views

How do I enable “Announce the time” programmatically?

The "Date & Time" System Preferences pane has an option to "Announce the time". I'd like to be able to turn on this preference option by invoking a shell script. Is this possible? (It's fine if ...
0
votes
2answers
556 views

How to make Applescript quit a specific program for all users?

My wife and I are set up on a single laptop and I have our iTunes libraries stored on an external HD. I'm writing an applescript to auto eject that drive when we want to take the laptop elsewhere (we ...
1
vote
1answer
179 views

How can I remove the Job Title and Company from all Address Book contacts using AppleScript?

I would like to remove the Job Title and Company from every contact in my address book using AppleScript. Any ideas?
3
votes
1answer
402 views

I want to run an applescript whenever a certain person signs onto my Messages buddy list

I want to run an applescript whenever a certain person signs onto my Messages buddy list Exactly. Thats exactly what I want. Pretty self explanatory. I am aware you can run applescripts for messages ...
3
votes
1answer
8k views

How do I click a button using AppleScript?

I'm trying to press a button in TeamSpeak using applescript, here is my code: tell application "TeamSpeak 3 Client" to activate tell application "System Events" tell process "TeamSpeak 3" ...
1
vote
1answer
334 views

An iTunes Applescript that appends to tag only when it doesn't match part of the tag string?

I'm trying to find a way to add a keyword or group of words/tags/strings to a set of selected iTunes tracks if they haven't been added. A use-case would be to add extra metadata in a comment such as ...
9
votes
4answers
3k views

AppleScript vs. Bash script?

I'm a long-time Windows "power user" and developer who has recently decided to move over to Mac OS X. On OS X Lion and indeed previous versions there seem to be two main options for scripting and ...
0
votes
1answer
368 views

pasting commands from TextWrangler to Terminal (applescript troubleshooting)

I have a following script that I have been using for years to paste selection or a whole line from TextWrangler to R. I got it from some website, slightly modified, and it has worked perfectly: tell ...
1
vote
2answers
1k views

Automate PDF actions

To improve my paperless workflow, I'm looking to achieve the following, potentially using automator / applescript. I need to be able to run it using Hazel, or as a folder action (not run manually): ...