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

learn more… | top users | synonyms (3)

1
vote
2answers
626 views

Using mdfind to evaluate the text content of a specified file?

I would like write an applescript to evaluate whether a particular file contains a specified string (perhaps as part of an if... then statement). I want to invoke a shell command using mdfind to do ...
2
votes
1answer
95 views

How to get inode from alias file?

In this MacWorld forum thread aliases are described as Aliases can reference an object in the file system either by a persistent ID or by path. Generally they will contain both pieces of ...
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 ...
1
vote
1answer
596 views

How to get color of pixel in coordinates 123, 456 in screen?

My AppleScript app needs to get color of pixel in coordinates 123, 456 in screen.
3
votes
2answers
312 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 ...
0
votes
2answers
141 views

How do i automatically send ebooks to my Kindle?

I would like to create an automation, that automatically sends a new file to my kindle email address if i put a new ebook into that folder. How would a script look like, that i would have to apply to ...
8
votes
3answers
2k views

How to add folder to Spotlight “do not index”?

Is there any way to programmatically add a folder to Spotlight's "Privacy" tab? Either through Terminal or Applescript? Often I want to click on an item in Spotlight results in Finder, and have that ...
0
votes
2answers
396 views

Thread count of process x?

My AppleScript needs to get thread count of process x. I have tried many ps etc codes but all these are not working for some reason. I tried these: do shell script "ps uH p 301 | wc -l" -->" ...
0
votes
2answers
98 views

What is the maximum amount of file arguments I can pass to a command?

If I do this in OS X, what is the maximum amount of files I can test? Or is there a maximum length for this string? do shell script "md5 -q 'path/to/file1.txt' 'path/to/file2.txt'"
3
votes
2answers
269 views

Have Voiceover read out just paragraph or sentence under cursor

I work with a disabled user who controls their iMac using keyboard and mouse input from their communication-aid. They have dyslexia and would like to use voiceover to read certain paragraphs or ...
2
votes
2answers
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 ...
2
votes
1answer
1k views

What techniques work to handle errors in AppleScript so I can place a dialog?

I'm new to programming and AppleScript and I have lots of problems with error handling. Could anybody share their error handling for file operations like move/trash files? Here is my code so far: ...
0
votes
1answer
1k views

copy calendar entries from one calendar to another via apple script throws error

i am trying to copy ical entries from one calendar to another using the following script: tell application "iCal" set localEvents to events of calendar "Privat" set remoteEvents to events of ...
0
votes
1answer
190 views

How do you set the selection in iTunes in an AppleScript

I'm writing a script in iTunes, part of which changes the selected playlist. When I'm all done, I want to restore the playlist and the selected tracks. I was able to do the first, but haven't found a ...
0
votes
1answer
944 views

Sending emails with the Apple Mail program using AppleScript.

I don’t know AppleScript at all so thanks in advance for any help offered on this question. I’m on my Macbook Pro laptop with the latest version of OSX installed. I have a csv file that looks like ...
0
votes
2answers
108 views

Process list with name and VPRVT

Is there any way to get just name and VPRVT of running processes?
2
votes
3answers
371 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
0answers
68 views

Have OS X auto-search for WiFi

My school has installed PowerCloud, which does not officially support OS X. It works sometimes, sometimes it doesn't. I've tried to narrow it down but it's impossible. I was wondering if there is a ...
0
votes
1answer
505 views

How to save AppleScript Editor Documents?

I try to save script in front most window in AppleScript Editor to desktop as text without using GUI scripting. tell application "AppleScript Editor" to save contents of document 1 as text in ((path ...
2
votes
1answer
311 views

How can I script Preferences changes in an application?

I want to use applescript to change a checkbox in the preferences box of Safari. I can open the preference window, but how to code the check box change? Example: I'd like to toggle the check box for ...
0
votes
1answer
30 views

Window and Menu IDs

There's a tool on OS X, and I can't remember what it is for the life of me, that will display what the menu and window IDs are of a selected tab, window, or checkbox. Can anyone refresh my memory?!
3
votes
2answers
349 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. ...
1
vote
4answers
8k views

How can I create a stand alone APP to run a terminal command

I have the requirement to manually run the OSX maintenance scripts in OSX (Lion / Mountain Lion). I would like to create a completely stand alone application that would achieve the following goals: ...
3
votes
1answer
264 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 ...
1
vote
1answer
1k views

Automator -> send file to email (from filename)

Im trying to create an Automator folder action that sends an email with an attached file. In my folder the files will be generated with the email as name: Example: name@company.com.jpg, ...
1
vote
2answers
1k views

How to go to tab 5 in Safari? (AppleScript)

Is there any way to go to tab number 5 in Safari? tell application "Safari" to set current tab of document 1 to 5
0
votes
1answer
2k views

Searching for items in list

I'm trying to search within a list of items (specifically, a list of files from a folder) for certain files. However, I don't know the names of these files; all I know is that they all begin with the ...
0
votes
1answer
291 views

Automator: start embedded YouTube

So, I need to show some kids a sequence of YouTube videos (with Automator, because there's no one available to man the computer for 30 minutes), but it's at a school where the YouTube domain is ...
1
vote
1answer
824 views

How to create Automator Service to change font of selected text?

I'm trying to create a "Service" in Automator that changes the font of the selected text in the frontmost app.
1
vote
2answers
299 views

Applescript to compare two lists of domains and eliminate duplicates

I tried to do this with Automator and found it...lacking. I have tried to look for solutions everywhere else I can think of, but my searches keep pointing me to Applescript as the only available ...
3
votes
2answers
2k 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\ ...
1
vote
1answer
577 views

Checking button text with applescript

I'm trying to automate CCleaner, so far I can start the application and click the button that starts the cleanup job, however I'm relying on a delay to determine when I should move onto the next ...
0
votes
1answer
252 views

Applescript and Fantastical

I trying to add a Fantastical event with AppleScript. Aparently the Fantastical Suite is quite simple as there is only one verb. parse sentence v : parse sentence parse sentence text : sentence ...
1
vote
1answer
102 views

How can I make compiled applescripts on $PATH be found and executed?

I have some short applescripts that I want to use as utility functions inside shell scripts-- for example, one returns the name of the frontmost application. The scripts reside in a personal scripts ...
0
votes
2answers
817 views

Applescript dialog, Bash alias/function

I'm trying to create a short alias for creating System dialogs from the Terminal. I tried to create a Bash function (since an alias didn't seem to take arguments) and add it to my .bash_profile, but ...
1
vote
1answer
682 views

using automator/applescript to upload files to a web form?

I have a bunch of files I want to upload to web page. Unfortunately the web form for uploading only allows me to specify one at a time (it spawns and 'open file' dialog). Is there an easy way to do ...
3
votes
1answer
1k views

Save attachments from Mail.app based on subject

I have been trying to write an Applescript to help me saving attachments, but realized quickly that I do not have the knowledge to do such a difficult script. Here is some background. We receive ...
1
vote
1answer
356 views

AppleScript: Open a new window in current space without switching to active window in another space

I want to have an application open a new window in the current space without switching to a space in which a window is already open, but I want to keep the When switching to an application, switch ...
5
votes
1answer
546 views

Execute a custom script when OS X 10.8 is in Power nap?

Apple new feature of OS X 10.8 in new Macs "Power Nap" checks email and does make backups. Is it possible to execute a custom script (bash, AppleScript,...) when OS X 10.8 is in Power nap mode? For ...
3
votes
2answers
2k views

Applescript giving error 1728 when checking if file exists

I'm trying to make compressing a video file using HandBrake easier through applescript and have been basing most of the code off of templates I've found. At this point in the code, the user has ...
2
votes
1answer
240 views

troubleshoot applescripted typing missing shift key and numerics in windows xp under parallels 8?

I am using a Windows XP VM with Parallels 8 under Mountain Lion. I have a remote desktop connection from XP that does not allow pasting from the clipboard, but typing works, of course. I have an ...
3
votes
3answers
4k 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 ...
1
vote
2answers
375 views

How can Growl trigger an shell script or AppleScript (NOT vice versa!)

When a Growl notification gets issued I want to trigger an AppleScript. I had a look at the "Actions" in the Growl preferences, and you can trigger things like an email or a text-to-speech call, but ...
2
votes
2answers
491 views

Using cURL to download images in XML feed?

I have an XML file that has links to various .jpg I want to create an applescript that downloads a local copy of these. The idea is to also label them sequentially with a number say 001 to 030. ...
0
votes
1answer
172 views

Toggle Apple Mail “Classic Layout” with shortcut?

Can anyone figure out a way to switch Apple Mail (v5.2) to/from "Classic Layout" mode with a hotkey? Maybe via Applescript?
2
votes
2answers
542 views

Inconsistent results when getting folder size in AppleScript

I'm using this line to get the size of a folder: set thesize to physical size of folder x The problem is that sometimes it works, other times it doesn't, and it's very annoying because there ...
0
votes
1answer
397 views

Applescript to automate drop-down selection in Mozilla Firefox

I'm trying to automate the selection of a value from a drop-down box in Mozilla using an applescript. What I want it to do is to tab to the drop-down box and enter down twice to select the third item ...
1
vote
0answers
81 views

Why would a Folder script stop working in 10.8.2? I have been using this script for several years

property disk : "Webserver:RAID:active_jobs" -- name of mounted disk where all work resides property folderactive : "Active" -- name of Folder were active jobs folders are held property destination : ...
1
vote
0answers
221 views

How do I tell Finder to read the network folder contents?

I use the following AppleScript script to automatically connect a remote drive when my VPN connection is established using Viscosity: do shell script "sleep 5" tell application "Finder" mount ...
0
votes
1answer
893 views

How to add a script that types in the password for my vps through applescript

I made a script recently and have turned it into an app, it basicly logs me into my vps via ssh but I don't know how to tell it how to type in my password for me, heres the code tell application ...