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

learn more… | top users | synonyms (3)

0
votes
4answers
842 views

How do I generate a random even number with Applescript?

I'm trying to create an Applescript that will change the MAC address of my router automatically. Some fields need to be even numbers but I can't figure out how to generate even numbers only. Heres ...
1
vote
2answers
393 views

Need Help with an Applescript / plist

This has been a learning experience for me. Everything checks out logically to me in this script/ plist but something isn't correct. Everything runs, but then the script runs every minute which is ...
1
vote
2answers
3k views

Can AppleScript automatically press a key for me in an application?

I'm trying to devices an AppleScript that will automatically press the right arrow key for 1 second, then the left arrow key for 1 second and repeat this in an endless loop until I interrupt it. Here ...
3
votes
1answer
299 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 ...
0
votes
1answer
454 views

how to auto download a certain attachment in mail

I have looked on stack exchange and other sites for a simple applescript. I have found more complex scripts that it's hard for me to understand (not knowing a lot about the applescript syntax). So, ...
0
votes
2answers
353 views

Writing an e-Mail app in applescript

I'm using a webmail account(NOT Gmail: hate its interface), and I DON'T want to use the mac's Mail app(must maintain double contacts lists for one thing). I use Google Chrome and have set the ...
0
votes
2answers
375 views

Running Applescript using cron jobs not working

I'm new to conjobs and applescript but I have the script done correctly i believe. (any critique is welcome) I don't want to bloat my calendar with events to do this because I use my calendar for ...
11
votes
8answers
11k views

How to retrieve current wattage info on OS X?

Is there a way to retrieve the current watt usage info on OS X Snow Leopard? I'm using mid-2010 iMac, so I'm not looking for just battery-related apps. Does OS X even monitor power usage? Do I need ...
2
votes
1answer
257 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 ...
10
votes
3answers
11k views

iCal No Longer Runs Scripts?

I have some automated tasks in the form of AppleScripts which I would schedule to run overnight via an iCal event. The event would simply be set to "run script" at "0 minutes before the event" and ...
0
votes
0answers
54 views

FileMaker 6 and AppleScript: Deleting a Menu Item

I am trying to write an AppleScript to delete or at least disable certain menu items in FileMaker pro 6. My documentation indicates that it can be done, yet even the exact examples that they give, do ...
1
vote
1answer
113 views

Source code to string in variable

In AppleScript Editor i can see that source_code has script content but row 2 fails for some reason. set source_code to load script (POSIX file "/path/to/script.scpt") word 2 of source_code This ...
3
votes
1answer
548 views

Are there more robust tools than Automator to extract text from multiple PDF?

There is an action in Automator that allows you to programmatically "Extract PDF Text", but it fails when fed a moderate amount of files (25 to 100). Worse, it fails without logging anything helpful ...
1
vote
0answers
178 views

Can I find and replace Core Text/Cocoa text strings in any application?

My scenario: I use an app called Antetype for UI design. Antetype uses OS X-native technologies for text rendering (it uses the system-standard text palette). Antetype does not have a find and ...
0
votes
1answer
44 views

Is it possible to show custom icons in the Scripts menu?

You know that "scripts" menu you can show in the right side of the menu bar? It's very useful. I'm talking about this menu: I've set some custom icons for the files in the scripts folder using the ...
1
vote
2answers
621 views

Applescript - ignore modifier keys

I have an applescript that needs to be called by an external program with command-shift-click. However, the applescript then performs keystrokes with command & shift held down. How do I get ...
1
vote
0answers
701 views

Can a new mail be sent using AppleScript + Outlook + IMAP?

I'm trying to use apple script to automate creation of a new outlook mail message. The below code will work when I have my email account sent up as pop3 but I need it to work with an IMAP account. ...
0
votes
1answer
241 views

Swap Mouse Button using AppleScript

I use mouse with left-hand. My system is shared with other people who are right handed. So, I need frequently to switch mouse button. I would like to know how to swap mouse button using AppleScript? ...
0
votes
1answer
156 views

Set environment variable for the process before startup [duplicate]

I have the following situation: I have Mac OS bundle with application which uses some 3rd party dylib's and those dylib's depend on some env variable, let's name it ENV_VAR. I want to set ENV_VAR to ...
1
vote
0answers
139 views

Touching files in correct order

This code touches files in alphabetical order. I need to touch files in order it is in list_of_files, so first it touches file2, then file3, then file1). Is there any other way to do this than to ...
3
votes
1answer
141 views

Can I run an AppleScript upon my 3G modem connecting?

I'm looking for a way to run an AppleScript after my 3G modem is successfully connected to the carrier. The modem is using the standard OSX network panel to connect, so it's not using any crappy ...
3
votes
1answer
546 views

“@” symbol in password in applescript

I am using an applescript to mount a users home folder. However, when I use a password with a "@" symbol the script fails since the "@" symbol is also the separator between the password and ...
-1
votes
1answer
43 views

Creating preview and icon for screenshots [closed]

I would like to make this code to automatically create preview and icon so it looks nice in Finder and so i don't have to wait my graphics app to create these things when i first time open in browse ...
2
votes
2answers
2k views

Creating wrapper script for Mail.app to send mail from Terminal

I'm trying to send mail from terminal with the help of bash and applescript. I use bash for taking care of arguments and the email message body. Then I have tried using Applescript to send the mail ...
2
votes
2answers
478 views

Applescript to run when iPhone connects/disconnects

I'm trying to figure out how to run an applescript when I connect and disconnect my iPhone with the USB cable. So far, I think I can run an applescript when it connects by using Image Capture ...
3
votes
1answer
365 views

Is there a maximum length of metadata that can be written in one xattr command?

Is there any text length limitations for how long text can be put to xattr? I plan to put my AppleScripts source code to script files so Spotlight can find it. Using Finder Comments isn't an option ...
1
vote
2answers
731 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
101 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
2k 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
680 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.
11
votes
4answers
5k views

Creating an automated HFS+ compressed folder

I would like to set up an automated way for archiving files in OS X Lion. By archiving I mean using HFS+ compression feature on a specific folder, and make every file that I move into this folder ...
0
votes
1answer
6k views

Automatically Save Attachments in Mail.app in 10.8 Mountain Lion

I am trying to automatically save all email sent to one address (let's call it test@example.com) to this folder /Users/luomat/Dropbox/Incoming/e2w/ (where /Users/luomat = $HOME). Here is the rule ...
0
votes
2answers
534 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
110 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'"
1
vote
1answer
381 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 ...
3
votes
2answers
325 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
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
270 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 ...
2
votes
3answers
434 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
2answers
608 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
1k 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 ...
1
vote
1answer
2k 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, ...
2
votes
0answers
70 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
546 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
434 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 ...
1
vote
4answers
9k 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
2answers
372 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. ...
5
votes
3answers
12k views

How can I trim the first 3 characters in file name with AppleScript?

Is there a way to trim off the first 3 character of multiple file names? (or last 3 characters)
0
votes
1answer
31 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?!
1
vote
1answer
3k 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 ...