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
30 views

Global keyboard shortcut to switch to an application (to use with Emacs/Aquamacs)

Like in iTerm, I'd like to be able to set a keyboard shortcut to switch to an application, which in this case would be Aquamacs. This would be really useful to know in general. Would an Applescript or ...
1
vote
1answer
143 views

screensaver causes error “share does not exist on the server” to endless loop

I've been trying to learn to automate my home Mac environment with Applescript. I've had some success, but am running into seemingly inconsistent and troublesome errors. In order to diagnose the ...
6
votes
3answers
6k 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 ...
0
votes
0answers
91 views

Automator: Verify connectivity to server, if yes, then copy files to server. If no, wait until available

I also asked this question on the Apple Discussion forums, but have had no replies.. Details required: I'm already able to copy files to/from server.home (Windows 2008 r2) via SMB, both within the ...
1
vote
1answer
72 views

Why is my script editor coming up with connection invalid after running it for a while?

This is the script I've found on the web I'm trying to just have the script drop items for me by pressing 1, but it works only for a little while before script comes up with an error "error "System ...
0
votes
1answer
84 views

Script Editor crashing when running Applescript

I need to extract the phone number of all the contacts in a particular group and for that I am using the following code - on run {input, parameters} tell application "Contacts" set ...
2
votes
3answers
397 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
0answers
73 views

Extract links from email based on the anchor text, not the href

I am putting together an Automator workflow that will allow me to bind a hotkey to a Smart Mailbox listing and effectively automate the task of clicking "Unsubscribe" in emails which have that text ...
1
vote
1answer
160 views

Can I use AppleScript to upload a file to a webpage open in Safari using drag and drop?

I would like to create an AppleScript to open a specified URL in Safari, login automatically if that would be possible and then upload a file to a form that accepts drag and drop file upload. Would ...
2
votes
0answers
154 views

Tell application “Microsoft Outlook” not working after Yosemite upgrade

I have two Macs. The AppleScript code below runs on one Mac ("Mac 1"), but not on the other ("Mac 2"). Mac 1 is running Snow Leopard, where Mac 2 was upgraded to Yosemite, and the AppleScript below ...
0
votes
1answer
196 views

Export reminders from osx Reminders app programmatically

I need to get reminders list in any form (could parse it later) from Reminders app in osx (10.9.1) I know that i could do it from menu, but i need it programmatically. Perfectly it would be some ...
0
votes
0answers
33 views

Automator: Delete source images after importing them is not working

I have an automator script that takes photos from a particular folder and adds it to a particular album in iphotos. One of the function block used is Import Files into iPhotos. with the option ...
2
votes
2answers
213 views

Help with a simple email script for OSX

I would be so happy if someone could assist me in creating an Applescript to send some emails. I have seen a few examples but I am not confident that I can adapt them to my own needs. I need to send ...
0
votes
2answers
110 views

Process list with name and VPRVT

Is there any way to get just name and VPRVT of running processes?
1
vote
1answer
93 views

Folder Action for hiding files according to type

Here's what I need. I need a folder action that hides files according to their extensions. (I do not need a folder action that hides extensions for visible files.) This action needs to apply to every ...
0
votes
0answers
17 views

imagesnap code not doing what it should

I edited most of this code from the website below (not a hyperlink because I'm just giving credit. http://hints.macworld.com/article.php?story=20100117064356428 So fairly simple script just build a ...
1
vote
1answer
44 views

Can I add actions to control automator to automator?

Is there any way that I can add automator itself to the list of services I can automate? For example right now I can go and add a launch application action to the workflow and within that action ...
0
votes
0answers
63 views

Can I configure calendar alarms from automator before they are created?

In automator you can make calendar alarms that are ridiculously useful. One that I often use is a little automation that will create and send an email whenever the calendar alarm is triggered by the ...
1
vote
1answer
42 views

CD-ing a file to itself

I wrote an application in Applescript to open a black picture and fullscreen it in preview. I need the app to "cd" to itself, no matter where it is. That means if it is on the desktop it can pull up ...
0
votes
0answers
43 views

Hooking into establishing Wi-Fi connection on Yosemite

Is there a way to hook into the process of establishing a Wi-Fi connection for executing some arbitrary actions (i.e. scripts or something) on certain events like connection established, connection ...
2
votes
0answers
57 views

Export image from clipboard to folder

I create a lot of mockups for my mobile phone. I recently heard of the brilliant idea to just put your current mockup as an image into your Dropbox (or whatever cloud your using). Then just take your ...
1
vote
1answer
54 views

Applescript to open Get Info box for the previous iTunes track?

I like having a hotkey to bring up the get info box for the current iTunes track so that if I'm using another app and a song comes up, I can quickly edit it. This works (though if it's not the best ...
2
votes
2answers
114 views

Git pre-commit hook that checks for open application

I am using git to manage a project that has a few binary files that need to be closed before being committed. So I need a git hook, that checks to see if the application that has these files open is ...
1
vote
4answers
120 views

AppleScript executes itself again after a reboot it initiated. How to avoid that?

I have a shell script that is run by an AppleScript app. That shell script restarts the machine at some point with shutdown -r now. How can I avoid having the AppleScript application automatically ...
1
vote
0answers
15 views
2
votes
2answers
522 views

Run a program/script when the screen is locked or unlocked

Is there a way to run a specified script or program when the screen is locked or unlocked? Ideally a bash function or an AppleScript. Is there an event that I could subscribe to that would allow me ...
1
vote
1answer
117 views

AppleScript-sent messages pop up as unsent drafts when trying to quit Mail

I have a spam processing script that I use to forward spam messages as attachments to my spam filter using the 'send' command in AppleScript. Everything processes and delivers fine, but later when I ...
1
vote
0answers
32 views

Speed up moving mails in Mail with AppleScript

Moving or deleting mails in Mail with AppleScript is dog slow. One of my scripts is: tell application "Mail" set SelectedMails to selection repeat with currentMail in SelectedMails ...
0
votes
1answer
329 views

Applescript to replace string using sed

I need and Applescript to replace some text as follow: Original text: string  string  string  $  text1 string  string  string  $  text2 text3 string  string  string  $  text4 The ...
1
vote
1answer
68 views

Show the Dock with AppleScript?

I would like to show the Dock when all windows are hidden/closed/minimized. Is this something that can be done with AppleScript? Where can I learn more about the specific capabilities of ...
1
vote
0answers
60 views

Applescript Service Won't Run From Some Applications

Okay, so I have a non-Apple keyboard and wanted to bind function keys to the basic media controls such as play/pause iTunes, change volume etc. So I decided to create a service in Automator with an ...
3
votes
1answer
369 views

AppleScript : do a mouse scroll on a Finder window

How can I do a mouse scroll on a Finder window in AppleScript ? I know there is keystroke for the keyboard, click for a mouse click, but is there something for the mouse wheel ?
0
votes
0answers
118 views

Mac Reset Password Prompt/Script

So, I'm setting up Mac's for new users. I create their profile and give a default password (the same one) to each new user. My question is, when the user goes into the computer for the first time(it ...
0
votes
0answers
109 views

Finder Menu Services No Longer Working

In Pre-Yosemite, I had some finder menu services (i.e. Right-Click, see 'Services' in menu, hover over, and you'd see Services created in Automator) that I made. As a developer, these were very handy ...
0
votes
1answer
238 views

How to set a custom icon inside a signed Apple Script application?

I'm using Apple Script to distribute a signed applet, and would like to use a custom icon. However, as soon as I export it from Script Editor, the bundle loses the custom applet.icns file I put in it. ...
2
votes
2answers
47 views

How to differentiate between applications with the same name in applescripts

I'm trying to use tell application "Google Chrome" in order to script the OS X Chrome app, but this keeps being interpreted as referring to a virtual application with the same name which refers to the ...
0
votes
2answers
170 views

iTunes/Applescript: get all tracks from (incomplete) album

I try to write an Applescript that would sort playlists by album. That is, a playlist P might contain 20 tracks split on 4 albums (A1, A2…). Each album has 10 tracks, in other words, on this playlist, ...
0
votes
1answer
124 views

Backup mailbox of mail.app with applescript

I would like to automate, with applescript, the back up a mailbox of mail, which is manually done with the menu "Export mailbox ...", but: I can not set the folder where the mailbox will be saved; I ...
1
vote
2answers
166 views

Alfred Terminal / Shell Command does not work

In Alfred, if I type > ls must open iTerm2 with that command. Well, does not work for me. In Application if I select Terminal instead of iTerm2, works. If I select Application → Custom, it ...
1
vote
0answers
327 views

Applescript, OS X : How to Get a list of phone numbers from Contacts, and send an iMessage with Messages App? Halfway there I think..?

I am trying to create an applescript that will grab all of the labeled phone numbers of 'mobile' and 'iPhone' from the every contact in Contacts App (specifically the phone numbers from the iCloud ...
0
votes
1answer
44 views

Apple Script help - how do I tell OS X to not launch a specific app during a specific time period?

How do I make an Apple Script (or something similar) that will tell OS X "do not launch/run (n) app from (x1) time to (x2) time?" Thank you.
6
votes
1answer
8k views

Where did “URL Access Scripting.app” go in Lion?

I have AppleScripts that run on a schedule to download files from URLs. They had been using URL Access Scripting.app's download event, which now looks to have disappeared from Lion. I can't find any ...
1
vote
1answer
49 views

Script Editor.app: newlines are formatted as CR rather than LF

I often use the builtin Script Editor.app to write, compile, and debug AppleScripts before I copy/paste the polished code into a shell script (with #!/usr/bin/osascript). That said, one really ...
4
votes
6answers
3k views

How to make an existing AppleScript file to work as a service?

I made an AppleScript, saved it as a file in a specific folder on my hard drive. Now I want to assign a shortcut to it and looks like I have to make a Service via Automator, but the Run AppleScript ...
0
votes
2answers
380 views

Applescript: path to files in application's Resources

I'm new to applescript and coding. I'm trying to make a little Applescript application that plays an audiofile contained in the .app, using: do shell script "afplay " & quoted form of ...
1
vote
2answers
522 views

How to add keyboard shortcut to toggle F1, F2, etc. as standard function keys?

I saw an AppleScript on Github to automate toggling F1, F2, etc. as standard function keys, but I don't know how to install it to my system and trigger it via a keyboard shortcut. Help? I am running ...
0
votes
2answers
100 views

How to create a record at the runtime in applescript?

I would like to create a variable of type record at the runtime, I found this could work: set bcd to run script ("{" & "abc" & ":" & "def" & "}") But it doesn't: error "The ...
1
vote
0answers
227 views

Access OS X Yosemite “Share Menu” extension through Apple Script

I'd like to make an Alfred workflow that would send a file as an attachment through Airmail. I noticed that Airmail has a "Share Menu" extension to do just that. Is there a way to access this ...
0
votes
1answer
151 views

Error in applescript “Invalid index”

I have an automator workflow which works fine except for a part of it - applescript. This is how the workflow goes - Run applescript (this part works fine) - on run {input, parameters} tell ...
0
votes
0answers
16 views

Click a checkbox by knowing its position

I'm in the need of clicking a checkbox without knowing its name (it changes randomly, but its position remains the same). Is it possible to click it just by knowing its position? I've tried this ...