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

learn more… | top users | synonyms (3)

2
votes
2answers
409 views

Applescript to quit all active browser processes

I am trying to quit all the active browsers using the below code, but am unable to get the list of all active browsers to quit. tell application "System Events" set appList to every process ...
1
vote
2answers
1k views

How can I automatically run an AppleScript on shutdown or logout?

I am more used to the Javascript style event handlers, but is there a similar thing in applescript that listens to system events like logout or shutdown to execute code or is there a way to have an ...
1
vote
1answer
500 views

How to start an app in the foreground?

For some reason, gitk always starts under all other apps. How to make it start on top of all other apps, like a normal program? Start it from the terminal with the gitk command, which lives in ...
0
votes
1answer
1k views

Position windows via command line

I've got a little bit of ruby that sizes and repositions windows to a saved layout. It uses a snippet of AppleScript to actually do the positioning: osascript -e 'tell application "Twitter" to set ...
1
vote
2answers
947 views

Cannot start MySQL server with AppleScript - Snow Leopard

I've sucessfully installed MySQL server (5.5.11) on my MAC Snow Leopard. I can start the server using PreferencePane, using command line sudo /usr/local/mysql/bin/mysqld_safe but cannot use the same ...
1
vote
2answers
1k views

How to check which files are not in iTunes library, but are in iTunes folder?

This is a question from Wil Wheaton's google+, but I would like to get an answer too, stackexchange style. Suppose you have all your music in a folder called /iTunes/Music. When you add files to ...
1
vote
4answers
1k views

AppleScript to mark video file as TV show?

I'm using Hazel to automate the conversion of video files to iTunes .mv4 format, however one limitation I've run into is being able to mark a video file as "TV show" or "Movie" before adding to ...
0
votes
2answers
679 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?
2
votes
1answer
245 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 ...
3
votes
1answer
300 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
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 ...
3
votes
1answer
434 views

Problem with my applescript to export keynote files to powerpoint

I've a big problem with an export applescript. I would like to export many keynote files to powerpoint files. I found this script below, but there is an error that tells that the menu item ...
3
votes
1answer
764 views

Get notified when battery is charged

Is there a way to write a custom apple script or any other way to get a Alert or Desktop notification when the battery on my Macbook Pro reaches a certain percentage of charge?
1
vote
1answer
505 views

How do I command Automator to convert the multiple images from PNG to ICNS once at all? (Solved)

I use OS X Mountain 10.8.2. I used Automator and added AppleScript, copying the command from the old app's developer at the Iconoodle - Convenient ICNS to PNG image conversion (Iconoodle isn't ...
2
votes
1answer
420 views

How to replace images in iPhoto with higher quality versions?

I use Aperture for photo editing and processing, but prefer iPhoto for keeping a gallery of my pictures. For a long time, I used the built-in tools in iPhoto to "Import from Aperture Library". What I ...
3
votes
1answer
636 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 ...
1
vote
1answer
111 views

How to start a service automatically after openning an application?

For example, I have a service that I want it to be started automatically when I open Firefox. I know how to write scripts as services in automator, but I don't know how to make a hook that when ...
1
vote
2answers
480 views

Automatically move files into correct folder on server

I often need to move files from one location on a server into a set of hierarchical folders. The filenames are usually 7 digits long - sometimes with some extra characters at the end. The folders ...
0
votes
1answer
417 views

Programmatically read both per-tab Terminal.app titles

When bringing up the Inspector (⌘I) in Terminal.app to edit the title (⇧⌘I), there are actually two titles that can be entered. The first is known as the Tab Title and affects the terminal window ...
1
vote
2answers
4k views

How can I get certain types of files dropped in certain folders based on file type?

I was wondering if it is possible to have the following: In my Downloads folder, I have 2 subfolders : IMAGES and VIDEOS. Is it possible to automatically move every image downloaded to the Downloads ...
3
votes
1answer
663 views

Combining Finder's File Open/save dialog with Alfred

Finder's Open/Save File dialog is actually very dumb (in terms of flexibility). When I look for a file or its location, I can probably find it much faster using Alfred. However, in many cases, you ...
0
votes
1answer
2k views

How to initiate a specific keystroke using automator?

I have the following code : on run {input, parameters} if application "KeyboardViewer" is running then quit application "KeyboardViewer" else activate application ...
-1
votes
1answer
454 views

Applescript opens new window for everything when run

I have the following code I did for a tweetbot keyboard shortcut to open tweetbot and create a new tweet. on run {input, parameters} activate application "Tweetbot 2" tell application ...
1
vote
1answer
226 views

F.lux does not always work on resolution changes. Is there a way to check if the resolution changes?

I'm a happy user of f.lux, but sometimes when I plug in my external monitor on my macbook air it returns to full brightness. This also sometimes happens if I unplug my external monitor and switch to ...
3
votes
0answers
311 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' | ...
2
votes
1answer
361 views

Can I run a program whenever I open the lid of my MacBook Air? [duplicate]

Possible Duplicate: Run AppleScript after waking from Sleep? I have a program, InstantShot!, set to launch at logon and start taking a screen shot every 10 seconds. Unfortunately, when I ...
4
votes
3answers
645 views

How can I make this Apple Script shorter? (quitting multiple apps via tell)

I want to edit a part of an Apple Script to quit various applications at once: tell application "TweetDeck" quit end tell tell application "Google Chrome" quit end tell Over all there are ...
0
votes
4answers
687 views

Pressing the control key with AppleScript

I use Voice Over and Dragon Dictate. I have figured out how to make Dragon Dictate press Control-Option-A, which makes Voice Over read a page of text, and now I would like to figure out how to tell ...
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 ...
2
votes
2answers
433 views

Safari bookmark to activate an Automator action

I'm trying to make a HTML page that I can save as a bookmark in Safari or Google Chrome that runs an Automator workflow, action or application, or possibly an Applescript. It's only for my personal ...
3
votes
1answer
435 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 ...
0
votes
2answers
292 views

How do I copy the location of a track to the “Comments” section in iTunes?

I dont understand why this is not working. If anybody knows how to resolve this issue: tell application "iTunes" copy location of track 1 of playlist "Test" to Comments end tell Applescript ...
0
votes
2answers
614 views

Display a notification with AppleScript

I would like to trigger a notification with AppleScript. I have seen How can I trigger a Notification Center notification from an AppleScript or shell script? but I would like to have a native ...
2
votes
2answers
588 views

How can I reproduce the Finder sort order without asking Finder to sort for me?

I work with a large collection of mostly-text files subdivided by series, periodically mirroring them from an upstream repository and repackaging them using a shell script from a slightly chaotic ...
3
votes
1answer
469 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 ...
0
votes
1answer
328 views

Set Specific Podcasts to Show as TV Shows in iTunes, using AppleScript

I'm using on online TV recorder to record TV shows. Those recordings are downloaded as a podcast to iTunes. My following Applescript should just grab those podcasts, update some info fields and ...
0
votes
2answers
548 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 ...
1
vote
2answers
429 views

How to suppress the “Run or quit” dialog when launching an applescript?

I am having the same basic problem as in this question: AppleScript app started prompting to run or quit. How can I disable this? However, in my case the "Startup Screen" option is definitely NOT ...
4
votes
5answers
2k views

How can I remove leading/trailing whitespace from filenames in Automator?

My wife tediously renames files all the time when storing on her backup external storage, so I investigated using automator to do this for her. I now have an automator folder where she just drops the ...
1
vote
1answer
199 views

How to run Excel on headless Mac?

I'd like to run applescript to control Excel on a headless Mac. I want to do it from the command line via ssh, and I cannot - there is no display to run applescript on, so osascript throws an error. ...
3
votes
3answers
3k views

Software to record and playback mouse movement/clicks and keyboard presses?

I was wondering if there was any software out there that could record mouse/keyboard input and allow you to play back the input that was made? I've tried using Automator but for some reason it's not ...
8
votes
4answers
883 views

Copying formatted text from a web page to an Applescript input dialog

I have an Applescript which - simplified - looks like this: ... display dialog "foo" default answer "" ... One of the users of this script runs Lion. Whenever he tries to copy/paste a string to the ...
4
votes
1answer
3k views

Using UI scripting to enter text in a file dialog

I am very, very new to using AppleScript. I need to enter text into the search box. So far the script looks like this: on run {input, parameters} tell application "myApplication" to activate ...
1
vote
3answers
821 views

Make a screen-shot and upload with a script

I am not very good with AppleScript but I would imagine this is something quite easy for the AppleScript guru out there, I am looking to make a screenshot of a region like with doing Apple-Shift-s and ...
2
votes
1answer
220 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
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): ...
0
votes
1answer
689 views

Script to turn flagged emails into reminders

I am looking for a script that will recognize when an email is flagged and then turn it into a Reminder using the Reminders app.
4
votes
1answer
3k views

Is there an Automator action to create Keynote presentation from text file?

I need to import a text file (consisting of subtitles) into a Keynote presentation. I need to turn each subtitle into a single slide, interspersed with blank (black) slides. I'd like to create an ...
1
vote
2answers
599 views

AppleScript “Open With…” icon

I've written an AppleScript app that I use to open certain files with (it sends them to Vim in the Terminal). I'd like to set all my .Tex files to automatically open with this app. The problem is ...
6
votes
1answer
373 views

Any way to get the “Open With…” list via AppleScript?

I want to create an AppleScript that gets the Finder selection and displays a list of applications that are capable of opening it. In other words, is there any way to get the list of apps that ...