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

learn more… | top users | synonyms (2)

1
vote
2answers
39 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 ...
3
votes
0answers
20 views

What are the differences between Applescripts saved as *.scpt and *.applescript?

It seems to me that those scripts that are saved as *.applescript are always meant to be the raw, uncompiled text while those that are saved as *.scpt can be either the raw text or the compiled ...
0
votes
1answer
46 views

Applescript Delay not working since switch to Yosemite

Ever since I upgraded to Yosemite, Applescripts that use delays have stopped working. How can I fix this? Here's the world's simplest Applescript, for the sake of an easy example: set volume output ...
0
votes
0answers
8 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 ...
0
votes
0answers
7 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
7 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
27 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 ...
1
vote
1answer
22 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 ...
1
vote
0answers
13 views

Toggle notification center's DoNotDisturb from terminal [duplicate]

Is there any way to toggle it with i.e. osascript? I'm on Yosemite.
1
vote
4answers
38 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
1answer
35 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 ...
1
vote
0answers
17 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
46 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
41 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 ...
2
votes
2answers
41 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 ...
2
votes
0answers
33 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
0answers
12 views

Including Python Script Dependencies (virtualenv contents) in Platypus

I'm trying to turn a python script into a OS X App that you can run directly from Finder. I'm trying out Platypus, which seemed like the simplest option. The problem I'm running into is with the ...
1
vote
0answers
15 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 ...
0
votes
0answers
33 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
2answers
45 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
40 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
1answer
41 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
17 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
1answer
40 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 ...
0
votes
2answers
39 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
2answers
54 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
49 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 ...
1
vote
1answer
23 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 ...
0
votes
2answers
51 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
244 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 ...
1
vote
0answers
56 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
45 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
13 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 ...
0
votes
0answers
31 views

How to move automator “Folder actions” workflow to desired folder?

Similar topics was discussed here. But the solution provided there was to right click on file name and select location (Automator 2.3), however that option was not present in Automator 2.3. ...
0
votes
1answer
46 views

How can Apple Script open a shell script with options in a Terminal window?

I’m trying to use Apple Script to execute a shell script file in a new Terminal window, while sending it options. How do I do that? It seems as if Terminal only interprets the path to the script, and ...
0
votes
1answer
52 views

Can I script my mac to reboot and login at a specified time?

Can I use shell scripts, AppleScript, or some other form of scripting to get my mac to reboot and login at a specified time? If so, how?
0
votes
1answer
14 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.
1
vote
2answers
145 views

How to open a shell script in a new Terminal window and run it with administrator privileges

I need to programmatically open a shell script in a Terminal window and run it with administrator privileges. I'm using osascript as it displays a convenient prompt for an admin login/password. I'm ...
0
votes
0answers
49 views

Automator Apple script: expected end of line but found “”"

I'm trying to run a simple Apple script that opens iTerm2, cd to a terminal and launches a command. The script goes like this: on run {input, parameters} tell application "iTerm" activate ...
-1
votes
0answers
23 views

Mail Authentication Error

I've been trying to use applescript to connect my Hotmail account to Mail.app. So far, I've gotten as far as setting up the account successfully. However, when I try to automate sending a message, the ...
-1
votes
1answer
76 views

Creating an account and sending mail using applescript

I'm trying to use applescript to do two things: Create an account in Mail.app Using that account, send an email in Mail.app I'm having an issue with creating an account on Mail.app mainly because ...
0
votes
1answer
52 views

How to check is Chrome is running in incognito mode using Applescript?

Is it possible to find out if the Chrome is running in incognito mode? if application "Google Chrome" is running then tell application "Finder" to display dialog "Chrome is running" // ...
0
votes
0answers
19 views

How do I accomplish the same task of a Bash script with an Apple script?

The following BASH script was written for a self-contained bundle, I would like to write an Apple script to accomplish the same thing, also in a self-contained bundle. How can I convert this BASH ...
0
votes
1answer
72 views

How do I make an AppleScript use a Folder in the Contents of a Bundle for an alias on the Desktop?

I'm trying to write an AppleScript to make a temporary alias on the desktop from a folder that resides in the Bundle's Contents:Resources folder and then execute a terminal command that has an ...
0
votes
0answers
16 views

Automatically update Outlook details when password is changed

We've set up our Macs to use Mobile Accounts, so that the passwords get changed and these changes are reflected on our AD server. The problem we're having is that our clients use MS Outlook 2011, ...
1
vote
0answers
95 views

AppleScript to read all notifications in the Notification Center OSX 10.10 Yosemite

It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite): on run tell application "System Events" tell process "Notification Center" ...
1
vote
2answers
44 views

Applescript Searcher problem

The AppleScript code: on dialogBox(theMessage) display dialog theMessage default answer "" buttons {"Cancel", "Search"} default button 2 with title "Pick a search engine" end dialogBox ...
0
votes
0answers
46 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
0answers
99 views

Embed or link or set reminders or alerts in OneNote pages

Currently running OS X Yosemite. I've come to rely upon OneNote for Mac (despite all my misgivings about Microsoft anything). I've started to use it as a Bullet Journal and it works great for this. ...
0
votes
1answer
47 views

How do I collect all of my notes and highlights from iBooks?

I've got a lot of highlighting and notes in iBooks that I've read, and would like to be able to collect them in one easy to use and manipulate format (e.g for writing papers and citing quotes). For ...