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
1answer
237 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
416 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
593 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
69 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
538 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
408 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
362 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
11k 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?!
0
votes
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 ...
1
vote
2answers
185 views

automator: get a folder if it dropped or ask for one otherwise

I'm building an automator application that acts on a folder that needs to be specified. Until now, I've been using the "Ask for Finder items" action to ask for a the folder to be used, but I would ...
1
vote
2answers
816 views

How can one invoke a keyboard shortcut from within an AppleScript?

I need to invoke a keyboard shortcut from within an AppleScript code, later to be used as a startup item (i.e. the alternative to having to press something at every log in).
1
vote
1answer
940 views

How to create Automator Service to change font of selected text?

I'm trying to create a "Service" in Automator that changes the font of the selected text in the frontmost app.
0
votes
1answer
323 views

Automator: start embedded YouTube

So, I need to show some kids a sequence of YouTube videos (with Automator, because there's no one available to man the computer for 30 minutes), but it's at a school where the YouTube domain is ...
8
votes
3answers
2k views

Copying files to the clipboard using applescript

Often I find myself at the command line wanting to copy files to the clipboard, so that I can paste them as attachments in Mail. If I have an image file, image1.png, I can accomplish this with ...
1
vote
2answers
324 views

Applescript to compare two lists of domains and eliminate duplicates

I tried to do this with Automator and found it...lacking. I have tried to look for solutions everywhere else I can think of, but my searches keep pointing me to Applescript as the only available ...
1
vote
1answer
649 views

Checking button text with applescript

I'm trying to automate CCleaner, so far I can start the application and click the button that starts the cleanup job, however I'm relying on a delay to determine when I should move onto the next ...
2
votes
3answers
588 views

How can I run a PHP script by dropping file on icon?

I have a php script that takes a filename as an argument. When I run it from a terminal window I type ./my_script.php file_to_process.txt It works great! What I would like to be able to do is to ...
4
votes
2answers
2k views

Problem with empty spaces when executing shell commands in AppleScript

The following code to purge a directory recursively does not work because I cannot get past the Application Support folder. try do shell script "rm -r ~/Library/Application\ ...
2
votes
2answers
854 views

AppleScript to add files to an iOS app under iTunes

I know it's possible to write an AppleScript to add music and video files to the iTunes library. Is it also possible to write AppleScript to add files to iOS apps that use file sharing? For example, ...
0
votes
1answer
290 views

Applescript and Fantastical

I trying to add a Fantastical event with AppleScript. Aparently the Fantastical Suite is quite simple as there is only one verb. parse sentence v : parse sentence parse sentence text : sentence ...
2
votes
2answers
4k views

Can Applescript be used to automate a screen recording session on OS X?

I need to accomplish the following tasks from a script: Initiate a screen recording (with system audio). After a set delay, stop the recording. Save out to a file. Close the recording. I've tried ...
5
votes
2answers
2k views

Why does this applescript not actually set the input volume to zero?

I have this command that builds a script to mute the input volume. The input volume is not fully muted, though. It seems to be closer to 10% than 0%. osacompile -x -e 'tell application "System ...
1
vote
1answer
767 views

using automator/applescript to upload files to a web form?

I have a bunch of files I want to upload to web page. Unfortunately the web form for uploading only allows me to specify one at a time (it spawns and 'open file' dialog). Is there an easy way to do ...
0
votes
3answers
928 views

Applescript to disable screen saver through sending keystroke

I'm trying to write an applescript that will disable the screen saver through sending a keystroke. Something like sending a "shift key" pressed every 30 seconds. I don't want to have the applescript ...
5
votes
1answer
608 views

Execute a custom script when OS X 10.8 is in Power nap?

Apple new feature of OS X 10.8 in new Macs "Power Nap" checks email and does make backups. Is it possible to execute a custom script (bash, AppleScript,...) when OS X 10.8 is in Power nap mode? For ...
2
votes
2answers
562 views

Using cURL to download images in XML feed?

I have an XML file that has links to various .jpg I want to create an applescript that downloads a local copy of these. The idea is to also label them sequentially with a number say 001 to 030. ...
0
votes
1answer
417 views

Applescript to automate drop-down selection in Mozilla Firefox

I'm trying to automate the selection of a value from a drop-down box in Mozilla using an applescript. What I want it to do is to tab to the drop-down box and enter down twice to select the third item ...
1
vote
0answers
81 views

Why would a Folder script stop working in 10.8.2? I have been using this script for several years

property disk : "Webserver:RAID:active_jobs" -- name of mounted disk where all work resides property folderactive : "Active" -- name of Folder were active jobs folders are held property destination : ...
1
vote
0answers
247 views

How do I tell Finder to read the network folder contents?

I use the following AppleScript script to automatically connect a remote drive when my VPN connection is established using Viscosity: do shell script "sleep 5" tell application "Finder" mount ...
2
votes
1answer
771 views

Applescript to turn off Mission Control in OS X 10.7

I found most of the below on https://discussions.apple.com/thread/3046230?start=0&tstart=0, but I believe it relates to OSX10.6 (or earlier) given that Mission control seems to have replaced ...
1
vote
1answer
66 views

How to invoke a script when closing any file with a given extension

Is it possible to automatically invoke a given applescript when closing -any- file with a given extension in a specified folder (and subfolders)? If not in AS, is this possible in bash? (The AS I am ...
1
vote
2answers
497 views

Applescript creating Sym link with spaces in the path

I'm trying to create a sym link to a network directory when i log in. This is working for a couple of other directories without spaces in the name, but for the life of me I cannot get this one ...
0
votes
1answer
1k views

Apple Script + VPN + Textbox

I have an applescript : tell application "System Events" tell current location of network preferences set VPNService to service "VPN (Cisco IPSec)" if exists VPNService then ...
0
votes
1answer
1k views

Script to be activated if web page changes [closed]

I'm looking for a way to have a script running on my desktop that will check a certain webpage for changes every x seconds, and if a change is made, it gives me an alert. I understand that with ...
1
vote
2answers
3k views

Change Date Created based on the filename

I've downloaded a bunch of my Instagram images but the Date Created of the files is set to the time that I initiated the download. What I do have though is the Date Created in the filename. What I ...
2
votes
1answer
136 views

Unique volname for DMGs

We have a build process that is now doing the common layout for distributed DMGs. This is done in a way that I've seen in many places -- the DMG is attached, then Finder does its job via osascript. ...
2
votes
1answer
353 views

Is there a GUI viewer of databases created by Database Events?

I wrote a simple AppleScript that saves data to a Database Events database. I see the database (DBEV file) in my ~/Documents/Databases folder, and I am wondering if there is a simple graphical utility ...
0
votes
3answers
1k views

Setting a variable to the result of a terminal command within an applescript

I'm trying to make a script that ejects all connected external drives and does not move on until they are all disconnected. The main problem I'm having is being able to set the variable vol_count to ...
0
votes
1answer
806 views

Any way to delete custom fields of cards in Contacts.app?

Some custom fields of contact cards in Contacts.app are really annoying. For example, nicknames always appear in Mail.app. To make things worse, there seems to be no menu option to delete custom ...
2
votes
1answer
633 views

Automator finish one task before moving on?

I have automator running several applescript commands that I want to happen sequentially. For example, I have an empty trash command, then a shut down command. When I run the script, the computer ...
4
votes
1answer
296 views

Any way to write the Terminal scrollback history?

I would like to open a new tab in Terminal with custom scrollback history. The primary use-case is to "fork" an existing tab such that both tabs contain the same scrollback history, but more generally ...
1
vote
1answer
226 views

How can I remove the Job Title and Company from all Address Book contacts using AppleScript?

I would like to remove the Job Title and Company from every contact in my address book using AppleScript. Any ideas?
0
votes
2answers
492 views

Is there a dial from Addres Book and tel:/sip: protocol handler script/application available for 10.7?

We are currently using Mac OS X 10.6 and snomURLHandler to convert tel: uri's to a http GET request. This computer telephony integration let us click on a telephone number in Address Book.app and let ...
0
votes
2answers
524 views

Applescript to update year tag for audio files

I have a lot of tracks in iTunes where the files are named "music-NNNN.mp3" with NNNN being the year the track was recorded. How can I use Applescript to automatically set the year tag for these files ...
2
votes
2answers
426 views

Applescript to quit all active browser processes

I am trying to quit all the active browsers using the below code, but am unable to get the list of all active browsers to quit. tell application "System Events" set appList to every process ...
1
vote
2answers
1k views

How can I automatically run an AppleScript on shutdown or logout?

I am more used to the Javascript style event handlers, but is there a similar thing in applescript that listens to system events like logout or shutdown to execute code or is there a way to have an ...