AppleScript is a proprietary programming language in Mac OS X to control and exchange data with applications.
3
votes
1answer
178 views
AppleScript/Automator Workflow to restore OS X to “mint” condition
Under Mountain Lion, I wanted to create an AppleScript that would essentially restore my OS X install to "mint" condition, if possible even to the point of showing you the ML welcome screen asking you ...
1
vote
2answers
216 views
How can I reproduce the Finder sort order without asking Finder to sort for me?
I work with a large collection of mostly-text files subdivided by series, periodically mirroring them from an upstream repository and repackaging them using a shell script from a slightly chaotic ...
4
votes
1answer
732 views
Using applescript, how to move a window to my second display?
I have experimented with absolutely every possible scripting option I can find on the web, and no matter what I do I cannot move a FaceTime window to my secondary display.
This works...
tell ...
0
votes
0answers
116 views
iCloud Find My Mac configuration using script
A Macbook Pro from a friend of mine was stolen and I am trying to create a script in order to activate the 'Find My Mac' feature of is iCloud account configured in his Macbook Pro.
Is there a way to ...
8
votes
3answers
483 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
173 views
How to suppress the “Run or quit” dialog when launching an applescript?
I am having the same basic problem as in this question:
AppleScript app started prompting to run or quit. How can I disable this?
However, in my case the "Startup Screen" option is definitely NOT ...
0
votes
1answer
130 views
Set Specific Podcasts to Show as TV Shows in iTunes, using AppleScript
I'm using on online TV recorder to record TV shows. Those recordings are downloaded as a podcast to iTunes. My following Applescript should just grab those podcasts, update some info fields and ...
3
votes
2answers
441 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 ...
3
votes
1answer
150 views
Applescript - Connection is invalid
I have an application for mac and I use the following applescript code (exported as an AS app) to start that app periodically:
on idle
tell application "System Events"
tell application ...
1
vote
1answer
182 views
Script to delete all groups in contacts
I would like to have a script to delete all my groups in my Contacts.
Somehow I got a kind of replication bug resulting in over 500 groups.
Delete them one by one is not an option.
Tried this script, ...
1
vote
1answer
114 views
How to run Excel on headless Mac?
I'd like to run applescript to control Excel on a headless Mac.
I want to do it from the command line via ssh, and I cannot - there is no display to run applescript on, so osascript throws an error.
...
1
vote
1answer
293 views
applescript to find contacts that are not in any group
I have been using a script that does not work anymore in mountain lion even though I have changed the words "address book" to "contacts".
If you select all the contacts, and then use the script, it ...
2
votes
1answer
370 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
565 views
Using UI scripting to enter text in a file dialog
I am very, very new to using AppleScript. I need to enter text into the search box. So far the script looks like this:
on run {input, parameters}
tell application "myApplication" to activate
...
3
votes
1answer
234 views
Can I send Notification Center items to my iPhone using Pushover or Prowl?
The title pretty much sums it up. I often feel like having notifications on my iPhone are a lot easier to notice, especially if you step away from the computer for a few moments to do something and ...
1
vote
2answers
840 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 ...
0
votes
0answers
803 views
How to create new message in iChat without sending, using Automator to grab selected text
I am trying to create a service that grabs the URL of some link, then create a blank iMessage with that URL in the body. Basically, I want to recreate that Message share feature in Safari in Mountain ...
2
votes
2answers
288 views
Is there a sane way to emulate the newer media key behavior completely on an Apple Extended Keyboard II?
The operative word here being "completely". I recently found a nearly flawless (cosmetically and functionally) AEKII (Alps, not Mitsumis) on eBay and won it for $30. It's an awesome keyboard and it ...
0
votes
1answer
257 views
Script to turn flagged emails into reminders
I am looking for a script that will recognize when an email is flagged and then turn it into a Reminder using the Reminders app.
6
votes
1answer
150 views
Any way to get the “Open With…” list via AppleScript?
I want to create an AppleScript that gets the Finder selection and displays a list of applications that are capable of opening it.
In other words, is there any way to get the list of apps that ...
2
votes
1answer
171 views
AppleScript SL to ML Issue (compatibility error?)
I've written the following script in Applescript in Snow Leopard, and I tried to use it in Mountain Lion, but to no avail (doesn't work). The script watches a folder for added files, and if the ...
1
vote
2answers
996 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 ...
0
votes
1answer
189 views
Detect the TV Show, Season and Episode from a mp4 file in applescript
Assuming I have an MP4/M4V file of a TV show. The file has the necessary metadata so it can be imported into iTunes and you'll see the all the relevant information. Using AppleScript, one can extract ...
0
votes
1answer
435 views
AppleScript to compare contacts in two groups and remove duplicate from one group
I want to create an AppleScript for Apple's Address Book (Contacts) app that will look at two Groups, and if a contact is in one Group, it will remove it from the other Group.
Specifically, I add ...
1
vote
1answer
371 views
Insert images into Pages document using AppleScript
I'm trying to automate the construction of a document, and am looking for a way to insert images into a Pages document with AppleScript. For example:
tell application "Pages"
make new document
...
1
vote
0answers
466 views
How to avoid the GUI password prompt when using `osascript`?
I’d like to use the osascript shell command to run some AppleScript, but I’d rather avoid the GUI password prompt. Instead, I’d prefer to run the script as sudo from the command-line, so no GUI ...
2
votes
1answer
411 views
How do I create an AppleScript that will quit an application at a specific time and then put the computer to sleep?
I've been toying around with AppleScript and Automator to get this thing to work, but I just can't seem wrap my head around it. If anyone could show me an example or give me some tips on how I can set ...
5
votes
1answer
292 views
Toggle Finder sort order with AppleScript under Lion 10.7?
For years I've been using this AppleScript to toggle the sort order of a Finder window:
if sort direction of column id size column of list view options of window 1 is normal then
set sort ...
0
votes
2answers
198 views
How to get the path of the selected Image in Adobe Bridge via Applescript?
I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this:
set ...
5
votes
2answers
406 views
How to disable individual USB ports by script?
I am looking for a script which will allow me to disable one specific USB port on my Mac mini. It would only serve a purpose if it works in real-time and didn't require a reboot. I've found scripts ...
0
votes
2answers
224 views
How can I connect Linux server with Applescript using iTerm or Terminal?
I want to connect and run bash script on Linux server automatically by using Applescript and iTerm or Terminal on OS X.
How can I connect Linux server with Applescript use iTerm or Terminal?
0
votes
1answer
323 views
Drag and drop from iPhoto may remove the pictures from iPhoto Library, how to recover it?
I modified the "Recursive Image File Processing Droplet" example provided from Apple in AppleScript Editor to rename any dropped file and move it to a custom folder. It worked seemingly flawlessly ...
8
votes
3answers
5k 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 ...
10
votes
6answers
4k views
How to set screen resolution with a keyboard shortcut on Retina MBP?
I've found myself switching between the 1440x900 and 1920x1200 "effective resolution" setting depending on what I'm doing (need more space on screen, etc).
Is there a way to toggle between these two ...
2
votes
1answer
475 views
Why won't my AppleScript run as a Service?
I have a simple AppleScript that works exactly as expected when run on its own, ether as an app, directly from within ScriptDebugger or Script Editor, or as an element of an Automation from within ...
1
vote
1answer
245 views
How do I change some text in an OmniGraffle document via AppleScript without changing the text's styling?
If I create an OmniGraffle document, add a text box with “Test” in red in size 28, I can change the text with this snippet of AppleScript:
tell application "OmniGraffle Professional 4"
set text ...
0
votes
1answer
87 views
Applescript won't play movie when waking from sleep
I have the following AppleScript, which is triggered by iCal to act as my alarm clock:
set musicPath to the path to me as text
set musicPath to text items 1 thru -12 of musicPath as text
set ...
3
votes
2answers
903 views
How can I bring a window to frontmost without focusing it using Applescript in OS X 10.8
I want to bring a window (QuickTime for example) to frontmost, without focusing it. I can do it in OS X 10.7 using the following code in Applescript.
tell application "System Events"
set visible ...
0
votes
1answer
126 views
Trying to use applescript to launch cmd line 3 scripts in new tabs
I'm trying to launch 3 tabs and run a script in each with applescript. So far I havent been able to get this done. Currently I have:
tell application "Terminal"
activate
do script "ping ...
1
vote
2answers
406 views
How do i pass variables' values between subsequent applescript runs? (persistent value between script executions)
I have an applescript that I run like a cron job. Within this applescript, i have variables that act like boolean switches (i.e. on/off values). With subsequent runs, depending on whether the boolean ...
4
votes
2answers
2k views
Activating screen saver from AppleScript in Mountain Lion
I had a script that I used to use to activate my screen saver, and it no longer works in Mountain Lion.
It was a shell script that called an AppleScript script:
#!/bin/bash
osascript ...
3
votes
1answer
373 views
Does applescript's 'delay' function work when the computer is asleep?
I'm trying to make an alarm clock for myself with AppleScript after my old (physical) one crapped out. I've got a script that'll schedule a pmset wakeup at the requisite time. There's just the matter ...
0
votes
0answers
81 views
Permissions error accessing FileMaker 10 Server from AppleScript
I have an set of AppleScript scripts that talk to a FileMaker server to get some data. "get cell" statements are used for this. In one of the scripts, I get an error from a "get cell" line:
get cell ...
29
votes
3answers
12k views
How can I trigger a Notification Center notification from an AppleScript or shell script?
I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write.
Is there a built-in command or a third-party library I can use from either an ...
0
votes
0answers
145 views
AppleScript to tell Safari to save a PDF accessible through a given URL
I have URL "X". It points to a PDF file after redirection. I can't get around being subject to redirection, the web site does it and offers no direct links. It seems to be tracking accesses to files ...
1
vote
1answer
168 views
AppleScript to tell Adobe Reader to close a certain document
Adobe Reader has N documents open. One of them has a known filepath and title and it needs to be programmatically closed. How to go about doing this in AppleScript? Specifically, how can I:
Talk to ...
0
votes
1answer
116 views
Applescript to monitor terminal changes
I want to be able to check if a word appears in a terminal window running a java application and then display a notification. Any ideas?
2
votes
1answer
215 views
Finder list view, change column with to optimal with using AppleScript
I'm trying to create an AppleScript script that resizes the columns of Finder's list view (e.g. Name, Size …) to their optimal width (i.e. the minimum width where all text in the column is visible) on ...
2
votes
3answers
236 views
How can I see how long my computer has been active (as in not idle)
I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
0
votes
3answers
411 views
Applescript app to shut down Mathematica at a specific time of day
I have the following workflow that I need to execute on a daily basis for a period of days:
The computers start at a specified time, Mathematica and a specific Mathematica notebook launch and ...
