applescript

Not showing Dialog when opening file in Acrobat Pro using Applescript

When opening Adobe Acrobat Pro, whether it be through Applescript or finder, the introductory dialog is shown. Is there a way to not show this dialog without already having checked the "Don't Show Again" option when opening a document using Applescript? Photoshop and Illustrator Applescript libraries have ways of setting interaction ...

How can I improve performance when adding InDesign XMLElements via AppleScript?

I have an AppleScript program which creates XML tags and elements within an Adobe InDesign document. The data is in tables, and tagging each cell takes .5 seconds. The entire script takes several hours to complete. I can post the inner loop code, but I'm not sure if SO is supposed to be generic or specific. I'll let the mob decide. [ed...

Mac iWork/Pages Automation

There is a rich scripting model for Microsoft Office, but not so with Apple iWork, and specifically the word processor Pages. While there are some AppleScript hooks, it looks like the best approach is to manipulate the underlying XML data. This turns out to be pretty ugly because (for example) page breaks are stored in XML. So for examp...

Mail Message Link Handling

I've written an Applescript which when supplied with a Windows network link, will convert it to the correct smb:// equivelent for the server in our office, mount the network drive, and open the requested folder in Finder. I have this built in an application which just takes a pasted network path. Ideally I need this to trigger on clicki...

Is it possible to programmatically push files to a wireless SD card?

Is it possible to programmatically push files to a wireless SD card - like a www.eye.fi card? I use a Mac and thought I could do this using some AppleScript - but have not found a way... Derek ...

What is the best way to format a localized string in AppleScript?

When a script is saved as a bundle, it can use the localized string command to find the appropriate string, e.g. in Contents/Resources/English.lproj/Localizable.strings. If this is a format string, what is the best way to fill in the placeholders? In other words, what is the AppleScript equivalent of +[NSString stringWithFormat:]? One i...

Disk Activity in Applescript

How can I poll disk activity in Applescript? Check to see if disk X is being read, written, or idle every N seconds and do something. ...

How can I change the main display via AppleScript?

From the Displays pane in System Preferences, I can manually change the main monitor by dragging the menu bar from one display to the other. I'd like to automate this and make it part of an AppleScript. ...

In Applescript, how can I find out if a menu item is selected/focused?

I have a script for OS X 10.5 that focuses the Search box in the Help menu of any application. I have it on a key combination and, much like Spotlight, I want it to toggle when I run the script. So, I want to detect if the search box is already focused for typing, and if so, type Esc instead of clicking the Help menu. Here is the scri...

In Applescript, how can I get to the Help menu Search field, like Spotlight?

In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu. It should work just like the key combination for Spotlight, so if I run it again, it should dismiss the menu. I can run the script with Quicksi...

Using AppleScript to hide Keynote Text Fields in A Slide

I am no AppleScript Jedi, I've only done a few simple things, but I haven't been able to figure this one out and could use some help: My wife uses slides for her Art History courses and would like to use the same slides for exams (sans identifying names). Rather than create a new presentation, I'd like a tool that iterates through the s...

Applescriptable mySQL client - low cost or free?

Can anyone recommend a MySQL front end client or OS X that is AppleScriptable? Preferably low cost or free. ...

Change Sound (or other) System Preferences in Mac OS X

I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is something that switches the preference instantly, like SoundSource but it has to be scriptable. T...

Using AppleScript to grab the URL from the frontmost window in web browsers: The definitive list

I built a widget that grabs the URL from the frontmost window in Safari, then allows you to shorten it using the tr.im API. Works sweet as. I want to make this more flexible, so am investigating how to grab an URL from other browsers. Here's the AppleScript that works in Safari: tell application "Safari" return URL of front documen...

Can't do shell script with a repeat with i from 1 to n loop

This works (prints, for example, “3 arguments”): to run argv do shell script "echo " & (count argv) & " arguments" end run This doesn't (prints only “Argument 3: three”, and not the previous two arguments): to run argv do shell script "echo " & (count argv) & " arguments" repeat with i from 1 to (count argv) do shell script "ec...

Create Applescript in windows?

I have a C# web application that needs to deploy a file to the client computer's hard drive. (A javascript file for Adobe Acrobat) If the client is using a mac, I have an applescript that will search their applications directory for acrobat and then deploy the JS file in the correct location. The problem is that I am currently creating...

How to send ^K to shell

I want to run a shell command in Terminal, then clear the console, from Applescript. If I was doing this by hand, I'd use ^K -- how do I send the ^K character in a string to Terminal? ...

How to programmatically generate a PDF from any document on OSX?

I'm working on a project for OSX where the user can pick a collection of documents (from any application) which I need to generate PDF's from. The standard Macintosh Print dialog has a PDF button which has a number of PDF-related commands including "Save as PDF...". However, I need to generate the PDF file without requiring user interac...

Applescript application read from file

I have a compiled applescript application which I have moved to my windows server. I'd like to then insert a text file into the application (which looks like a zip file on windows): myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt So, i've precompiled the applescript to try to read from this text file and get the contents as...

Use AppleScript or other Mac OS method to get filename and path of open files

Is there any way to use AppleScript (or something else) to query currently running applications for the filename and path of the current file that they have open? I know some applications show the filename in the window title which is script accessible, but this isn't a solution as not all do, and hardly any show the path. I also know ...