AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

5
votes
5answers
4k views

Apple Mail: Flag message from keyboard

One of the flags in Apple Mail can be applied to a message using Command-Shift-L. Is there a way to apply any other flag? I renamed one of the colors to TODO, and I set up a keyboard shortcut for ...
5
votes
2answers
12k views

How do I automate clicking a button in an application's window with AppleScript?

Let's say I want to click a button that appears somewhere within a window, using AppleScript. click button works, but you have to know which button exactly you want to press. For example: Scanning ...
1
vote
1answer
690 views

How to programmatically flip a QuickTime movie metadata attribute from one kind to another

I have about 1,700 QuickTime movie files (some have .mov extension, most do not; it's not important, all are seen by the system as "QuickTime movie" and that's what they are) in an organized folder ...
2
votes
1answer
191 views

Set file creation date by reading modified date

How can I set a file's creation date as the modified date? e.g. File is made on Monday, edited on Tuesday. On Wednesday I want the date modified and date created to be set to Tuesday. Thanks!
3
votes
1answer
1k views

Set OS X application preference to stop prompting for admin password

I am trying to write an applescript that sends some actions to an application (specifically waterroof). The problem is, the application periodically asks me for the admin password when I open the ...
11
votes
1answer
1k views

OS X Lion Inverted Scrolling Automation Shortcut

As everyone will know (who has Mac OS X Lion), by default, scrolling is inverted to make it a bit like the iPhone. Problem: There is no way to have "normal scrolling" for a USB mouse, and "natural/...
2
votes
1answer
482 views

OS X Lion: AppleScript unbearably slow for moving Mail messages

I've been using for years now the following applescript, triggered via iKey by an F12 keystroke: tell application "Mail" to move (get selection) to mailbox "Archive" I'm using it to move inbox ...
4
votes
5answers
11k views

Toggle “ask for password after screensaver/sleep” or the delay in 10.7 using terminal

There's an option in the preference panel to change the time the mac is able to be in sleep/screensaver before requiring a password to be unlocked again. I'm using OS X Lion 10.7. Is there any way ...
8
votes
1answer
6k views

Automated Interaction with Google Chrome

All right SU, I have a fun nut to crack. I have 8 screens set up in a line, all hooked into one beefy G5 running Snow Leopard (yes, 4 graphics cards; about 15,000 pixels wide!). I am setting up a ...
1
vote
2answers
333 views

Listing all known deleted OS X accounts

Where can I find Applescript code or a PList to get deleted usernames as known to the OS itself, regardless of the file system's deletions? Having to depend on folder hierarchies and backup disk ...
1
vote
1answer
208 views

How can I pause growl notifications via Terminal/Shell?

I was wondering if there was a way I could pause (hide) growl notifications from the command line? Failing that, is there a way to do this with an AppleScript?
13
votes
2answers
11k views

How do I set up an AppleScript to open a new iTerm2 tab and change the directory?

In OS X, how do I set up an AppleScript to open a new iTerm2 tab change to a directory clear the console echo the current directory I had something like this before for regular Terminal, but I ...
1
vote
1answer
1k views

Get path of open file in any application on Mac OS X?

I installed Afloat for Mac OS X and I really like that it has a shortcut to "Reveal Current File in Finder". This works for basically all applications written in Cocoa. Can I use something like that, ...
1
vote
0answers
142 views

Switch between Tabs with Applescript

I have a cocoa-applescript application whose GUI interface has 3 tabs.The identifiers for these 3 tabs are "item 1" "item 2" and "item 3" respectively. Tab1 is the default tab with a form on it. Tab ...
0
votes
1answer
125 views

Resume Execution from where a function left -Applescript

I have an app coded in Applescript where a dialog pops up with three buttons: {Help, Add, Subtract} . When user taps the Help button, a dialog should popup displaying information about the app.This ...
1
vote
2answers
4k views

Get path of sub-folder's Parent : Applescript

I want to get the path of a subfolder's parent folder when I drop a folder on a application coded in Applescript So if I drop a folder called 'Test1' which is on the Desktop I want the script to ...
2
votes
1answer
200 views

Limiting number or closing oldest open Safari windows

My son is autistic and opens so many new Safari windows playing flash movies that his MacBook often becomes so unresponsive that it's faster to hard reboot it than wait for the force quit dialog to ...
3
votes
1answer
2k views

Selective Play/Pause VLC and iTunes with AppleScript

I have 5 button mouse, and i currently using one button for play/pause the music in iTunes (with USB Overdrive app). But sometimes i'm using VLC (i don't want scre up my music library with lot of s*it)...
0
votes
2answers
897 views

How can I get the foreground color in Photoshop with AppleScript?

How can I get the foreground color in Photoshop with AppleScript? Preferably in hex format.
1
vote
2answers
3k views

Use launchctl to fire an AppleScript script periodically

I have written an AppleScript that lets me back up a particular file. The script runs fine inside AppleScript Editor: it does what it's supposed to do perfectly. So far so good. Now I'd like to run ...
4
votes
3answers
5k views

Automatic PDF renaming based on title

I have thousands of scientific PDFs that i need to rename, many do not have metadata. I would like to be able to create an automator action that could open a folder then open each PDF, copy the title ...
-2
votes
1answer
4k views

If then statement using applescript in mac terminal?

What would be the code for: "If $foo is one, then $foo should now equal 18" ? Thanks
0
votes
1answer
279 views

Applescript to Windows script (VB or java)

I want to have a button in Powerpoint (2003) and have it open iTunes to a specific playlist and start playing using AppleScript tell application "iTunes" play playlist "iTunes DJ" end tell ...
0
votes
2answers
2k views

How to select the “File Name” radio box with Applescript GUI

I'm running OS X 10.6 and I want to use applescript to click on the "File Name" radio button of the finder window when the search is open. (It defaults to "Contents") I used the UI Browser (below) ...
1
vote
1answer
1k views

Is there a good utility for resizing application windows to preset sizes in OS X?

I've been using the Better Touch Tool and Right Zoom to be able to maximize windows to full screen, and to resize windows to the center, or top right / left quarter of the screen. Those apps are ...
4
votes
4answers
5k views

Switch between Google Chrome Tabs using AppleScript

I was hoping that the following code would do the job, but no cigar: --Only the window is brought into focus tell application "Google Chrome" activate tab 1 of window 1 end tell
0
votes
1answer
207 views

Submitting an applescript to xgrid using osascript

I'm trying to submit an applescript to an xgrid using the command line. But I've got something wrong with the formatting. For example this doesn't work. I just get the help screen for xgrid in ...
2
votes
2answers
3k views

In OSX, can I launch, position and scale an application using applescript/automator?

I am looking to automate the launching of my workspace. I use several applications, carefully positioned across two monitors, and I would like to be able to launch my prefered layouts with a single ...
0
votes
1answer
1k views

Change Mac “Ask for password after screensaver” delay

How can I change my Mac OS X Snow Leopard "Ask for password after screensaver" delay? I've tried: defaults -currentHost write com.apple.screensaver askForPasswordDelay -int 3600 but won't work. I ...
0
votes
1answer
821 views

Reveal in PathFinder/Finder

We are using AppleScript to reveal files from our application in the Finder. If a user has alternatives, e.g., PathFinder, installed as a replacement for Finder, how we can find our what application ...
0
votes
0answers
342 views

Force a file to overwrite instead of appending the filename

I've got an application running is OS X 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 ...
0
votes
3answers
151 views

Emulate “Go to Dekstop/Home/etc.” behavior in OS X via AppleScript

OS X has build in support for going to certain Folders (Home, Utilities, Desktop, etc.) via a Shortcut. I wanted to emulate this behavior for the the Downloads Folder. The only thing that is missing ...
2
votes
2answers
4k views

Open Terminal Here, as Root (OS X)

There is a pretty awesome applescript called "Open Terminal Here" ( http://www.entropy.ch/software/applescript/ ) which you can add to your finder's toolbar and click when you want to launch a ...
1
vote
1answer
88 views

Is it possible to set a Custom quick look preview image in OS X?

Is there any way to set a custom quick look image in OS X? I'd like a command line tool or applescript to change or embed a custom preview for a zip file using a jpeg.
1
vote
3answers
1k views

AppleScript problem: 'do shell script' with backslashes '/'

I am trying to create an applet which takes the selected items in the Finder and creates a ist of RTF links in the clipboard, using AppleScript. The code is : tell application "Finder" to set s to ...
0
votes
1answer
322 views

Using AppleScript to Enable Snow Leopard's Text Replacement Feature

I currently use Quicksilver with a Plugin and Trigger in concert with Snow Leopard's text replacement feature (for frequently-used combinations of hashtags, due dates and other parameters) to quickly ...
1
vote
2answers
3k views

How to I use Apple Script to change the keyboard layout on Snow Leopard? [duplicate]

Possible Duplicate: Switch TO specific input source I want to do something like: set keyboard layout to 'QWERTY' or something like that.
0
votes
1answer
2k views

How to analyze strings on Applescript/mac

How would I write a script to analyze strings in Applescript (or other scripting program for mac)? Example: scan text file for "I love eating", copy subsequent text, end at ".", so that if my file ...
2
votes
1answer
661 views

Can you resize all mac windows at once? (e.g. when docking)

I've recently bought a Henge Dock, and like the ability to plug my MacBook in and instantly reconnect to all my peripherals (external monitor, keyboard, mouse, etc.). The only problem is that when I ...
1
vote
1answer
2k views

Mouse movement vertical axis inversion? (Mac OS X)

I would like to either run an AppleScript or use a Terminal command to invert the y-axis for mouse movement in OSX— and no, not like http://d.pr/w9z7 (/joke). Any ideas? I thought about checking for ...
1
vote
4answers
5k views

Applescript save command for QuickTime Player

I've installed the Perian addon for Quicktime so it can open .flv files, and then I can save them as .m4v or .mov. I'm trying to make an Applescript to convert from .flv to .m4v automatically by ...
1
vote
1answer
129 views

Cron jobs and clipboards

Pbpaste doesn't seem to work as expected when I run it from a cron job. I have an applescript that opens a PDF file in Preview and sends it the copy command and then closes Preview. Next I'd like to ...
1
vote
0answers
145 views

Desktop Picture Placement

I made an Automator app that changes the desktop picture to whatever image file you drop on its icon. It used to work perfectly until Snow Leopard. Now the image placement always resets to Full Screen,...
2
votes
2answers
438 views

Trying to silence Terminal Applescript

I have an Applescript that changes directory for the front Terminal window to the front Finder window. It works fine, but it also outputs text which clutters my terminal window. Does anyone have any ...
1
vote
3answers
324 views

Is there a way to avoid having to click Autofill in iTunes?

I'm tired of always having to click "Autofill" in iTunes to put new songs and podcasts on my second generation iPod shuffle so I'm looking for a way to automate this with a keyboard shortcut, ...
3
votes
1answer
1k views

How do you send the “ESC” key in OS X using osascript

I'd like to create a small script using osascript in Mac OS X Snow Leopard to emulate pressing the Escape key on the keyboard. How is this most easily done?
9
votes
4answers
7k views

Applescript to open a NEW terminal window in current space

Yes, I'm having a terrible newbie experience with Apple Script. I need to open a new Terminal window in the current desktop space. NOT move me to another space which has a Terminal running and then ...
1
vote
0answers
179 views

process pdf attachments with applescript and pdfpenpro

I've set up a gmail account that will contain nothing but emails with pdf attachments. I've also set apple mail up to check this account. Now, I would like to set up an applescript to take the pdfs ...
1
vote
2answers
296 views

Is there a way to stop iTunes after the currently playing radio song ends?

While scripts like This Is The Last Song and Just Play This One work great with local songs, they don't seem to work with Internet radio stations like Groove Salad in spite of the fact that the name ...
0
votes
0answers
596 views

Script Mail.app to auto-save attachments?

In similar thinking to a previous question, is it possible to script Apple's Mail.app to auto-save attachments from a given address or file type? Presuming it is, what would that AppleScript look ...