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

learn more… | top users | synonyms (3)

5
votes
3answers
563 views

How do I create a Folder Action Script to tar items dropped in folder?

I would like to drop/copy files/folders and have them compressed then copied to my desktop. This is what I know so far... and it isn't much so any help would be appreciated. on adding folder items to ...
1
vote
2answers
389 views

Why does iterating over a list in applescript with `repeat with … in` fail with error code `-1731` part way through the list?

I have this script for ensuring that every track in a given smart playlist is both shufflable and bookmarkable. The script is inteded to be launched via launchd. All of this is set up fine except ...
0
votes
1answer
377 views

Applescript - Run Multiple Instances of an App in Mac OSX

I was hoping one of you kind folks could help me write a script that would open another instance of Transmission. From my online research, I took a stab at making my own and compiled the following ...
1
vote
1answer
160 views

System event key codes not working on thunderbolt display

My AppleScript works when I am just using my MacBook Pro Retina, however if i have my Thunderbolt Display attached the script does not work. Here is the script which works perfectly on just the ...
3
votes
2answers
1k views

Emulating associative arrays in AppleScript

A problem that would be trivial to solve with key=>value pairs. For each item in list_a, find the matching item in list_b and compare a single attribute (calculate scale ratio for two sets of images). ...
1
vote
0answers
396 views

Progress Indicator for AppleScript

Okay, so I have an AppleScript that is really just a wrapper for a simple shell script, so I could turn it into a double-click to run application, droplet and URI handler on OS X. Anyway, this works ...
1
vote
1answer
251 views

Applescript IF statement with click and keystroke?

I would like to make a script that press down the shift button every time i click on something and maintains it pressed until I release click. Something like: If click then key down shift "when click ...
0
votes
1answer
176 views

Open contact group on Mac

I just want to use AppleScript to open an existing group in Mac Address Book (v7.1). tell application "Contacts" set selected of group "friend" to true activate end tell above is the sample ...
0
votes
2answers
481 views

AppleScript - more than title

I have a AppleScript that runs from a cron job. The script is: tell application "System Events" set frontApp to name of first application process whose frontmost is true end tell tell application ...
0
votes
1answer
265 views

How to ask for a mail folder in applescript?

I apologise in advance since this will be a long question. I hope that somebody with applescript knowledge can help me. I am transferring whole of my Windows machines to Apple and I am stuck with one ...
1
vote
1answer
2k views

Applescript - the activate command makes application “half-active”

What I did: Using this link, I created the following Applescript: tell application "System Events" click (first button whose subrole is "AXZoomButton") of (first window whose subrole is ...
2
votes
3answers
6k views

What is the Applescript command to show or hide iTerm2 window

Does anybody know the Applescript command to show or hide a iTerm2 terminal window? I use iTerm2 in a guake style command window and currently using one window and many tabs. My use case: I managed ...
3
votes
1answer
3k views

Set size of window to exact pixels, and place via x, y coordinates

I would like to create a tool that allows you to set windows to exact sizes on the pixel scale to be able to have more precise screen divisions. For example, if I had four Terminal windows (and I ...
1
vote
0answers
21 views

Possible to Detect All the Podcasts in iTunes That Are Marked to Not Allow Auto Delete?

I'd like to, for my own nefarious reasons, be able to see which files iTunes currently thinks it can't auto delete. Applescript or summat would be fine, although a smart playlist would be even ...
0
votes
1answer
66 views

How to get Mail.app raw message in the Automator?

This is an cross-post, because i'm not sure where it really belonging. It is programming question, but apple specific question too. Here is the stackoverflow link: ...
0
votes
2answers
1k views

Script or workflow to modify find and replace text in clipboard

I need give unique names to many, many files as part of my job. I download dozens of PDFs from a research database which all come with the same name (date of download). I have to open the file, select ...
2
votes
1answer
42 views

How can messages be scripted whenever I open a specific application?

Say I want to start Safari on my Mac. Can I create a pop up message that reads, "Use Chrome instead" or some other thing? I presume it may be possible with Applescript or something, but don't know ...
1
vote
1answer
652 views

Copy and Paste files into the same directory using Terminal

I am currently trying to figure out how to Copy and Paste files (more than one file) into the same directory using Terminal. I am trying to create a script to create the same file. If there is a ...
1
vote
1answer
423 views

Applescript to delete iMessages from Messages app

I have an Applescript that sends myself and colleagues iMessages when certain events happen. Some times hundreds of iMessages are sent in a short space of time to lots of people and the Messages app ...
1
vote
0answers
93 views

Apple script that closes Apple Remote Desktop

First let me say that I have ZERO experience in Apple Scripting. That said, I need to build a Apple Script or whatever is more efficient for that case, that is going to close Apple Remote Desktop ...
1
vote
0answers
172 views

How does one execute scripts within script bundles?

I am trying to make my completely enormous script more comprehensible by splitting it into a main script with bundled scripts to run when called, but I don't seem to understand how to run a bundled ...
0
votes
1answer
385 views

Expand Sending Email with Applescript

I read with interest the article regarding sending an email based upon parsing through a csv file to pick up the name and email address. This looks like most of what I need to accomplish my objective ...
1
vote
3answers
2k views

How Can I Create a Multi-Line Input Dialog using Applescript?

How can I create a multiline text input dialog using Applescript? Creating a single line dialog is simple...
1
vote
1answer
155 views

creating a resident workflow with automator

I currently have a simple workflow that gets the contents of the clipboard and creates a new text file from those contents on the desktop. problem is, i have to run the workflow everytime i need my ...
0
votes
1answer
686 views

How do I remove the Finder from the Dock automatically at login?

This is related to this question here, except that, in addition to removing the Finder, I want to do it automatically. There are several solutions on the web that suggest using this AppleScript: tell ...
1
vote
1answer
509 views

Messages applescript not working under Mountain Lion?

Tried adding an AppleScript to run a specific command when I'm sending or receiving a message in Messages on my server, but for some reason it never seems to get called. Placed it first in ...
0
votes
2answers
416 views

Mac OSX Apple Script, How do I make Apple Script push keys on an application

What I am trying to do is make my character run up 50 steps then down 50 steps repeatedly using the up key and the down key. I know how to utilize system events to push keys and I know how to tell ...
1
vote
2answers
786 views

Why does this Applescript often fail the first time, but always work after that?

The following Applescript opens a menubar app called QuickHue and then clicks a specified item in the menu. Often, when I use the applescript, it does nothing. But if I wait a moment or two and try ...
2
votes
1answer
143 views

Send mail after found new items inside the folder

I am running an applescript application using stay open option. Function of the script is: the applescript will ask for "javascript" to run the below is my code. the functions of the javascript is ...
0
votes
1answer
122 views

Applescript, quit app if other app is quit

I have a (very basic) apple script that I use as a trigger to start and hijack Plex, using Audio Hijack Pro. tell application "Audio Hijack Pro" start hijacking session named "Plex" end tell tell ...
1
vote
2answers
255 views

How do I invoke a service using Applescript?

I'm using Circus Ponies NoteBook which doesn't support Applescript methods. It does support creating services that can clip the current selection into a NoteBook page. This allows me to select text ...
0
votes
2answers
100 views

Toggle Mail Classic View in Mountain Lion with

I found a script on this site which I edited to make work with Mountain Lion, I thought. It works fine from Automator, but when I save as a service and assign a keystroke to it, it does not. Any help ...
0
votes
1answer
84 views

How do I add a custom field to the login dialog?

When the screensaver has been disturbed, or the computer wakes from sleep, my system asks for a password. I would like to add to this dialog. Along with username and password, there would be a third ...
1
vote
1answer
1k views

AppleScript to close “About this Mac” window

How could I use AppleScript code to close the window named "About this Mac" (A propos de ce Mac in French). I need an AppleScript for this because I use Dragon Dictate 3 commands. I am handicapped and ...
0
votes
0answers
114 views

How can I use AppleScript to reshow the last OS X notification (in the notification banner)?

After the notification disappears, I want to be able to make it appear again through AppleScript.
1
vote
4answers
12k views

method for using F4 key without press function button in one macbookpro

i'm using a program that uses the F4 key for a shurtcut. it is an important shortcut and i'm heavily using it. every time in my mac book pro for press F4 i have to press also the fn button. is there ...
1
vote
1answer
2k views

Applescript code to simulate Command and Shift keys

I am handicapped and use Dragon Dictate 3. I need to take control of my Mac with Dragon, because I am not be able to use the keyboard. I need to know some Applescript code to do that. How could I ...
0
votes
2answers
1k views

How to get Automator to treat text as RTF?

I am writing a book and trying to add a service to provide syntax highlighting to text selected in Pages with Automator. I have a service accepts selected text and runs it through a shell command ...
1
vote
1answer
319 views

Using AppleScript to modify contacts not working

I'm trying to use applescript to clean up various problems a large address book, to large to fix by hand. I've been able to find and observe contacts and groups in AppleScript successfully. However, ...
0
votes
1answer
3k views

Permission denied for symbolic link

I'm creating a symbolic link with the following applescript: on run do shell script "rm /usr/bin/ant" with administrator privileges do shell script "ln -s ...
1
vote
2answers
2k views

Why does my Automator service work in Automator but not when called from the OS?

I have made an Automator service that runs an Applescript with the Run Applescript module. This is the script: # Press ^F8 tell application "System Events" key code 100 using control down end ...
2
votes
4answers
389 views

How to get screenshot only external monitor?

I there any way to screenshot only external monitor screen? do shell script "screencapture -x " & shot_path
2
votes
1answer
49 views

How to test if video is local or stream?

If I watch a video in QuickTime Player, how I can test in my AppleScript, if this video file is on my Mac or is it streamed live from the net?
3
votes
1answer
1k views

System-Preferences Applescript using osascript cannot select its window

This AppleScript (based on an answer in a MacWorld form) will tell me whether or not Screen Sharing is enabled: tell application "System Preferences" reveal pane "com.apple.preferences.sharing" ...
0
votes
0answers
10 views

How to test if video is local or streamed from net? [duplicate]

If i watch video in QuickTime Player, how i can test in my AppleScript, is this video file in my Mac or is it streamed live from net? Anybody know address of QuickTime live streams i could use when ...
0
votes
1answer
49 views

script to cycle through multiple pdfs and want to close the windows

Hey everyone I am new to applescripting. I have a need for an applescript that will cycle through 3 PDFs, located out on a share drive. I have the script but the problem is that if a user overwrites ...
-2
votes
1answer
3k views

How to configure Automator to log into a website, each time generating a new random UID and email address?

I need to find a way to log into a company intranet site multiple times in quick succession on OS X 10.8.2, each time with a new completely random user ID and email address. The website only requires ...
4
votes
1answer
1k views

How to use environment variables in applescript

I'd like to use my environment variables, which were defined in my environment.plist file, in my applescript. How do I do that, for instance: log "Glassfish Home: " & AS_HOME Where AS_HOME is ...
2
votes
3answers
440 views

How can I set up a shell script as a wrapper to the main executable of an app?

I have an application that I want to launch via a shell script that does some setup and then launches the app itself with some specific options. Ideally, this script would be run whenever the ...
1
vote
1answer
465 views

Applescript to get Dropbox file direct/share link

Is it possible to retrieve the direct/share link of a file that is in my Dropbox folder, but not in its Public subfolder? I'd like to use that for an Alfred workflow. I saw many tutorials on how to ...