AppleScript is the Mac OS scripting language.

learn more… | top users | synonyms

1
vote
2answers
2k 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 ...
3
votes
3answers
4k 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
3k 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
270 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
1k 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 ...
3
votes
3answers
4k 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
2k 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
703 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
261 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
141 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
76 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
316 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
2k 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
621 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
4k 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
118 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
133 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 ...
2
votes
2answers
405 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
313 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?
8
votes
2answers
5k 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
171 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
288 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
587 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 ...
2
votes
1answer
682 views

How do I create a Genius playlist in iTunes 10 from a script?

I want to create a script that starts a new Genius playlist based on the currently-playing track to use in LaunchBar. Unfortunately iTunes doesn't expose any Genius-related functionality to ...
0
votes
2answers
2k views

self-closing applescript

so I'm totally new to applescript.. basically I want my applescript.app to run a shell script then exit do shell script "/usr/local/groovy/bin/groovyConsole" the above script opens groovyConsole ...
5
votes
1answer
1k views

Determine Mac's screen state using AppleScript

Is there a way to determine what state the Mac's screen is in? I'd like to have a script that checks if the screen is in a non-active state; so either the screen saver is running or the display is ...
1
vote
2answers
626 views

Add Secure notes to Keychain via Applescript

I have switched from Windows to Mac and one of the things I need to set up properly is password management. Previously on Windows I was using a small TrueCrypt file containing text files with ...
4
votes
1answer
597 views

AppleScript Editor record doesn't work

I have opened the AppleScript Editor and pressed Record button. Then I run TextEdit, create a file and put some text there. When I click Stop button in AppleScript Editor, nothing was recorded, the ...
2
votes
1answer
2k views

How do You Open the Contents of a Folder with AppleScript?

I am currently using this UNIX shell command in my script file: do shell script "open ~/Dropbox/Media/VisionBoard/*" Is there another way to do it and if so would it be any better or different? ...
0
votes
1answer
224 views

Set “Away” Status on Several Apps at Once

This question is slightly born out of laziness, but here goes anyway. I use the following apps on OSX: Skype Adium Linkinus On each, I have an automated status change that triggers after being ...
2
votes
1answer
993 views

Is there a way to use AppleScript to create an iCal alarm that runs AppleScript like you can manually?

All I see in iCal's dictionary are display, mail, sound, and open file alarms. Note: I know I can save the desired script as an app and create an open file alarm, but that would mean that the alarm ...
4
votes
1answer
1k views

How can I run a script whenever I plug in an external monitor? [duplicate]

Possible Duplicate: Reset Mac OS X Windows Position after de-attaching external monitor I use my laptop at work, where I have a second monitor, and at home, where I don't. When I plug in ...
1
vote
2answers
934 views

How do I escape a slash in AppleScript?

How do I escape a slash in AppleScript? The documentation seems to suggest that set target_string to "\\" should return a single \, but in fact it returns \\\\. On the other hand, set ...
0
votes
2answers
1k views

Inserting Keynote slides into a Pages document

I have a number of training documents which are formed from a word processor file and a slideshow. I'd like to be able to keep them together, ideally by inserting the slides from Keynote into Pages. ...
0
votes
2answers
2k views

AppleScript and Preview.app

I saw this post: http://superuser.com/questions/155517/how-do-i-get-applescript-to-work-with-preview-in-snow-leopard In my attempt to figure out how to use AppleScript with Preview. I'm trying to ...
1
vote
1answer
1k views

How to get QuickTime Player 7 to save its export settings?

I'm trying to get QuickTime Player 7 on Mac OS X 10.6.4 to save its export settings so I can batch convert some MKV movies to M4V (MPEG-4). I've already exported a movie using the settings I want. ...
0
votes
1answer
394 views

Bundle applescript into application from the command line

I can compile an applescript file into an application from the applescript editor, but I would like to be able to do this from the command line. Does anyone know how I can do this?
0
votes
1answer
2k views

How do I get applescript to work with Preview in Snow Leopard?

How do I get applescript to work with Preview in Snow Leopard? I'd like, for instance, my applescript for resizing a window to full screen (which works for most applications (e.g., chrome)) to work ...
1
vote
1answer
203 views

What are the pros of using Path Finder?

What are the pros of using Path Finder, and not Finder? Could I not get some of the features of Path Finder by adding Applescript scripts to the stock Finder?
25
votes
3answers
19k views

Assign a shortcut to running a script in OS X

Does OS X provide an easy way to bind key combinations to commands which are typically run on the command line? For example, is there some way to assign ⌘ Cmd+L as a global shortcut for ...
2
votes
1answer
583 views

Different Wallpaper if two monitors are attached

I am working on my MacBook Pro. In the office I have 1 27" Monitor attached to it, at home I tend to work without an second monitor. For that setup I want to change the wallpaper if no 2nd monitor is ...
0
votes
1answer
408 views

iDVD Random Transitions

I am creating a dvd slide show using iDVD and I see how to add transtions manually but what I would like to do is have iDVD insert random transitions for me. Is this possible?