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

learn more… | top users | synonyms (3)

16
votes
3answers
18k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
4
votes
3answers
399 views

Script to change downloaded mac wallpaper automatically?

I want to change my mac wallpaper daily with microsoft bing images. I found this script that download the daily picture automatically, but I sill have to set the wallpaper automatically. Is it ...
8
votes
4answers
3k views

look up a word in Dictionary.app in Terminal

Is there a bash or applescript to look up a word in /Applications/Dictionary.app from a Terminal window ? open -a /Applications/Dictionary.app/ --args word ignores --args, says "type a word to look ...
2
votes
1answer
209 views

AppleScript Quicktime Player to play audio file generates error

My Quicktime Player (Version 10.3 727.4) can play mp3 files without any problems, but when I use AppleScript I get an error message: The document “audio.mp3” could not be opened. The file may be ...
1
vote
2answers
93 views

Applescript (PDF to iTunes): How to extract and/or write metadata with special characters? Help please :-)

INTRODUCTION Hello there, Like always, I want to put in front that I'm not a script expert. I'm not even a basic coder. I just try to learn, little by little about coding when I have these ...
0
votes
1answer
149 views

how to re-enable services in an app (Microsoft Remote Desktop in particular)

I am fairly confident I could use the service below in MRD before. I am not sure when I lost them, maybe it is related to the Yosemite upgrade (I noticed this on 10.10.0) or some recent MRD update ...
1
vote
1answer
46 views

How to make a custom keybind that runs an applescript file?

No additional questions. I'm fine with installing an additional program.
0
votes
1answer
129 views

Filling the inputs of SecurityAgent if they exist?

I am trying to automate the export of my keychains (system and user), and while my script works if I remove the set values, it does not after adding them. The error I am receiving is System Events ...
0
votes
1answer
41 views

How to Change Scroll Speed Programmatically with Applescript or Shell Script

Is there a way, using either applescript or a shell script, to change the scroll speed? I don't even know where to begin to look for a mechanism for this. Oh, and no third-party applications either, ...
2
votes
1answer
34 views

Using Launchbar to make Popclip appear

PopClip is a Mac app that adds the iOS functionality of a bunch of options showing up above selected text. PopClip automatically appears every time I select text, and that's annoying, so I want to ...
0
votes
0answers
116 views

Setup and sync multiple Google Drives

I am trying to setup and sync multiple instances of Google Drive on OS X Mavericks. I have tried the two following instructions here, and here, but to no avail. Each time I try to run the new ...
0
votes
0answers
59 views

Automator Workflow - Reply To Outlook Messages with Template Text

I have pulled together the following workflow in Automator because my Scripting knowledge is non existent: Problem It pastes the text in unformatted, losing all paragraphs, bold, underlined, ...
7
votes
2answers
368 views

Why are Script Editor .scpt files not saved as plain text files?

The Script Editor (formerly ApplerScript Editor pre-Yosemite) saves .scpt files as binary files, not plain text files. It makes working with them in source code control systems somewhat cumbersome. ...
4
votes
1answer
113 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
127 views

How can I use Applescript or any other utility to send a daily text message to my bank?

I have searched and I find a lot of results for specific methods of sending an iMessage with Applescript, but they all seem to contain extraneous code for specific needs that I don't need. I'm ...
0
votes
0answers
103 views

FFMPEG via AUTOMATOR not working argument “drawtext timecode”

I am new to scripts and automation but I wrote a script to help me on my daily job of watermarking and burn in timecode on videos. I created an Automator drop on app to convert videos and watermark ...
1
vote
2answers
125 views

Simple 3 line applescript - Error -128

I have a scenario where I'd like 2 separate applescripts. The idea is super simple. 2 Applications, but only one runs at a time. Example: Close application 1, launch application 2 (and vise versa) ...
1
vote
1answer
227 views

Using applescript to create spaces and launch apps

So the end goal of what I am looking to do is this: When I am at work I use an external monitor with my MBP. I have a consistent set of spaces and apps that I setup everyday. What I would like to ...
2
votes
2answers
91 views

if application “Safari” visible is false then (AppleScript)

I would like to check if Safari is visible, my AppleScript code was this, but it doesn't work ... How can I check the visible with AppleScript? if application "Safari" visible is false then tell ...
3
votes
1answer
416 views

How can I avoid permission-related failures when importing in Photos.app via AppleScript?

The new Photos.app does not come with Automator support (although there are third-party actions available). It does, however, have some basic AppleScript support, including support for importing a ...
1
vote
3answers
1k views

Applescript dictionary for Preview

Is there an Applescript dictionary for Preview.app? I am unable to find it under Mac OS X 10.7.5, and Applescript 2.2.1. I did a rudimentary search in google and duckduck but came up empty. I've ...
-2
votes
1answer
81 views

applescript to unlock mac works very slow

Hello i am using this script to unlock the mac tell me to activate\n tell application \"System Events\" to keystroke \"PASSWORD\"\n tell application \"System Events\" to keystroke return\n tell ...
1
vote
0answers
24 views

Tell last media player to skip song

I bought a new keyboard that, of course, works almost perfectly, minus the media buttons. Luckily it has open source drivers specifically for linux and mac, but unfortunately the media buttons ...
-1
votes
1answer
2k views

How to add a script that types in the password for my vps through applescript

I made a script recently and have turned it into an app, it basicly logs me into my vps via ssh but I don't know how to tell it how to type in my password for me, heres the code tell application ...
0
votes
0answers
50 views

How can I securely store passwords in xcode app?

I'm writing an app with Xcode using Applescript-ObjC. I'm wanting to put in some usernames and passwords to automatically check some remote servers. How can I put these login credentials in the app ...
1
vote
1answer
248 views

How to Use Cancel Button in Osascript to Stop Running Script

Here is my basic script: #!/bin/bash osascript -e 'tell application id "com.apple.systemevents"' -e 'display dialog "Do you want to continue?" & return & return & " Please wait..." ...
0
votes
2answers
74 views

How to check if invisible items are visible?

How do I check in AppleScript, if invisible objects are visible? If visible, do: defaults write com.apple.finder AppleShowAllFiles 0 in invisible, do: defaults write com.apple.finder AppleShowAllFiles ...
1
vote
0answers
64 views

How to detect if chrome (or any other app) is playing sound using bash/applescript

I am writing a script to turn off audio on my mac, but need to check if its coming from the browser or an app (say Spotify). Is there a way to detect which app is playing sound?
3
votes
3answers
3k views

Using applescript to lock screen

I need an applescript which locks my Mac in the same way pressing "shift"+"ctrl"+"eject" would. I tried two different approaches, but both failed. The first one was to search the internet for a ...
0
votes
0answers
61 views

Applescript and iTunes: enable shuffle by song or album and play?

The documentation for shuffle/shufflable in the iTunes Applescript dictionary is really confusing, at least for me. As I read it shuffle seems to be a property of a playlist (not a state of the ...
-1
votes
2answers
209 views

AppleScript for restarting to Bootcamp?

I have tried to use an AppleScript to reboot to Windows It's not going well though, as when I tried it the first time, a white screen appeared on startup and didn't go away. A hard reset rebooted to ...
0
votes
1answer
105 views

Use AppleScript to play an iTunes Radio station vs. an iTunes Internet Radio station?

Looking for hints or a code snippet that will show me how to use AppleScript to play an iTunes Radio Station (with cover art, add to iTunes wish list, play more like) vs. playing an iTunes Internet ...
0
votes
1answer
146 views

Using Applescript to paste the current date into a range of Excel cells

I have a simple script written that successfully saves the current date in the format I need. I also have saved a destination range in the active sheet. I just need syntax to paste/insert it into that ...
1
vote
1answer
43 views

How to programmatically construct the name of application used to open directories?

This Emacs LISP script reveal-in-finder.el allows one to quickly open a directory in Finder from an Emacs buffer which has the directory opened in it in dired mode. But on my computer, I uses Path ...
2
votes
1answer
200 views

Applescript: Help to extract PDF “Author” metadata and set it in iTunes Author field

Using other applescript as template, I've been trying to modify this particular one to do the following task: Extract "Author" tag from a PDF file and write it automatically in the iTunes12 "Author" ...
0
votes
0answers
61 views

How do I a search with applescript cocoa that sets properties with actions

A little bit of context here, I have a text file which is compiled of all the computers and users of my network, its referenced so I can easily find and VNC into them. My regular applescript looks ...
2
votes
1answer
140 views

How to replace all Finder files with a placeholder file for each

I have lots of files from a database which are to be copied to a new database, but the files for these are corrupt (They are zero-byte in size and contain no data). Rather than the new database ...
0
votes
1answer
27 views

Launch Apple Script on App Focus

Is there a way to configure an Apple Script (or any script for that matter), to be run every time an application is focused? For example, if I am on Safari currently, and I tap on a QuickTime window, ...
2
votes
2answers
156 views

Make a file a Stationery pad via command line

Is there a way to set make a file into a Stationery pad from the command line? You can do it by clicking "Get info" on a file and checking the box, but I would like to do it without clicking. An ...
0
votes
0answers
27 views

AppleScript/Automator Add AutoCorrect Settings

I am making a AppleScript/automator script for April Fools that is going to change the AutoCorrect. I know that I can change the autocorrect settings by going to Settings > Text > '+' ...
1
vote
0answers
43 views

How can I programmatically read and write the texttone of a Contact in the OSX' Contacts app?

On the Contacts app (V9.0) of Mac OSX 10.10 Yosemite I want to read and write programatically the texttone property in some of my contacts. How can I do this with Applescript or another scripting ...
0
votes
0answers
256 views

How to iterate through iCal events in Applescript

I am trying to iterate through the events in a calendar to copy them to another: tell application "iCal" set localEvents to events of calendar "localCalendar" set remoteEvents to events of ...
2
votes
2answers
1k views

Is it possible to switch to a specific keyboard layout via `defaults`, *.plist or similar?

I have figured out a workable shell script using osascript (AppleScript) to automatically switch to US keyboard layout when MacVim activates (triggered by Keyboard Maestro), and Swedish layout when it ...
1
vote
0answers
31 views

How do I automate selecting files in a .jar file?

My .jar file has a number of buttons that, when clicked, prompts me to select a file to load. I need to find a way to get this file selection to be automated, and decided on applescript. ...
3
votes
2answers
356 views

How do I use screencapture for capturing floating windows?

I am trying to automate the periodic capture of a floating window. Specifically, of the floating 'Current Call' window which is used by Skype when the main window is off-screen. By googling, I found ...
6
votes
4answers
10k views

How do I make an AppleScript with a drop-down menu without Xcode?

How do I make an AppleScript that displays a drop-down menu without using Xcode?
1
vote
0answers
36 views

Forcing application to go to selected window on startup

I run a multi-monitor set-up on a single "Desktop". All of my applications when opened run on the primary monitor, which is the smaller monitor. I would like to have some (e.g. browser, mail client) ...
14
votes
3answers
10k views

How can I “say” to another Mac?

I have two Macs in our house (iMac and MacBook Pro). I would like to use the say command-line utility to type something on my MPB and have it speak on the iMac, rather like an intercom system. Plus, ...
2
votes
3answers
1k views

Check if a process is running, if not execute it again in Terminal

Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal? I have a PHP script that is needs ...
0
votes
0answers
45 views

Automator script doesn't show up in services menu

I made an automator script to help me to assign LaTeX indexes to words in TexMaker. It would convert a highlighted word test to \index{test} test. This is the little script: on run {input, ...