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
0answers
7 views

Keep screen off while moving mouse/clicking etc. (iMac)

Usually, with my macbook pro i can turn off the screen by setting the brightness to 0 and keep it off even if i move the mouse or do anything else (usually doing something with applescript). Now that ...
1
vote
0answers
25 views

How to run AppleScript (.scpt) as LaucnDaemon by root

I have an AppleScript or set of Applescripts that I am trying to run as a LaunchDaemon. I have no problem running the LaunchDaemon with my user. The problem comes in where I have the need to read a ...
0
votes
1answer
30 views

How to get and set metadata of a m4a file?

I am trying to automate some changes in m4a metadata and would prefer doing it through AppleScript other than popular solutions like mutagen. How can I address m4a files metadata? I need not only ...
0
votes
1answer
42 views

Make script run without interrupting GUI experience

I have an AppleScript that automatically opens SelfControl.app to help avoid distractions when I want to be working. The script is very similar to automate an Internet content filter, and it is ...
0
votes
1answer
10 views

type of emails from Contacts.app in AppleScript (on El Capitan)

I want to work with a list of all email addresses that appear in my address book. I thought I could simply set such a list with AppleScript, and use the elements, maybe after casting the references to ...
0
votes
1answer
38 views

applescript will not stop running

I have an applescript that utilizes a named pipe and pipes data over to it. I have my script passing said data in a while loop, which is working, but I find that I am unable to stop the script ...
0
votes
0answers
10 views

Smart Playlist in Itunes based on file location

I'd like to create a smart playlist in iTunes based on a specific folder (I manage my media library manually). Is that somehow still possible in ITunes 12 (even if it involves scripting)?
0
votes
1answer
15 views

Can a custom label be applied to a contact field using partial text from the field value?

In the Contacts app in OS X Yosemite it is currently impossible to import custom field labels when importing from a CSV file. I use a 3rd party app to manage my contacts and I would like to import the ...
1
vote
2answers
25 views

Can I replace characters in AppleScript?

I'm working on an AppleScript to mount our Active Directory Home Shares and I've come up with the following part that looks at the logged in users "SMBHome:" and it gives me the users home share but ...
0
votes
1answer
37 views

How does one Copy, Paste and Tab using AppleScript?

I am looking to automate Copy, Paste, Tab and Left in Microsoft Excel and either Safari or Firefox using Applescript. I have limited experience in coding, and have recently complied a code, but ...
0
votes
2answers
36 views

multiple dropbox instances hangs in starting loop

So I have recently installed two separate concurrent instances of dropbox on Mavericks. There are plenty of scripts on the web (all roughly the same) that seem to lead to a common issue, specifically ...
1
vote
0answers
14 views

Using osacript to access Finder from crontab (or from non-interactive session)

I have a script that generates a dmg file from my application bundle. This is generated every night from our subversion repository. If would be interesting to set up things like the DMG's window ...
1
vote
1answer
35 views

How to get the PID of every window of every process?

I'm using the following simple script: tell application "System Events" to get the title of every window of every process Which works by printing titles of every window (the same with position). Is ...
0
votes
1answer
30 views

How to activate and run JavaScript in AppleScript?

I'm trying to run simple script in AppleScript Editor on OS X 10.9.5, but using JavaScript, e.g.: var SE = new Application("System Events"); SE.processes.windows.name() However my dropdown only ...
0
votes
0answers
13 views

AppleEvent Handler failed (-10000)

I'm having issues with a simple part of script, where I wanna get the property dock preferences of System Events. I have the following: tell application "System Events" tell appearance ...
1
vote
1answer
33 views

Why is my AppleScript not working?

Making an AppleScript but for some reason it isn't working. Any ideas why not? delay 1 set volume 1 say "Hello " & (do shell script "whoami") using "Whisper" say "Do you want to play a game?" ...
0
votes
2answers
35 views

Gaining access to data acquired by AppleScript outside of the script

I'd be interested in using the data that I acquire with an AppleScript in another Framework, or even to write it to disk (the former is preferable). For example, I have an AppleScript where I ask ...
0
votes
1answer
36 views

Send Command to Add remote users through ARD

so I'm trying to create an extra admin account on all Macs on the network. There are quite a few so I'm trying to do it through Apple Remote Desktop. Do you guys know how to do this? This is all I ...
7
votes
5answers
186 views

How to create an OSX Application to wrap a call to a shell script?

My goal is to include in a zip file what amounts to a shortcut, instead of telling my customer(s) to open up Terminal and run a shell script. My deployable essentially looks like this: $ unzip ...
2
votes
2answers
145 views

AppleScript to create spacing format like “S P A C I N G”?

In order to format text documents in a more readable way it would be nice to format selected texts by an apple script executed via the context menu services in the following way: select "text" with ...
0
votes
0answers
50 views

Automator shell script - change file extension

I currently have a task that is working. It takes whatever files are added to particular folder and compresses them via Handbrake to another folder: for f in "$@" do HandBrakeCLI --preset="iPhone ...
1
vote
0answers
29 views

Applescript exits with error when run via launchd

I have an applescript running beautifully in Script Editor as well as from an osascript command at the Terminal. The script talks to the Reminders.app in order to pass iCloud reminder entries to a few ...
1
vote
0answers
23 views

How to create an app with the ability to open files in finder with right click

I want to create a very simple app like this: #!/bin/sh /opt/local/bin/evince $1 evince is a pdf viewer I compiled in OS X. I want to navigate to a pdf document in finder and then right click and ...
0
votes
2answers
26 views

Use Applescript/Automator to select a window highlighted in the Finder

I have an applescript which extracts the name, associated process and and other information about a target window. As of now, the script selects the target window via a "choose from list" dialog that ...
0
votes
0answers
71 views

Outlook 2016 for Mac won't return “current messages” from main window

In Outlook 2011 for Mac, I was able to use an AppleScript to move currently-selected messages from the main Outlook window. The script started like this: tell application "/Applications/Microsoft ...
-1
votes
0answers
8 views

don't understand command for playing audio in applescript through Quicktime [duplicate]

I'm making a very simple electronic sampler and I need to know how to play audio in applescript. I heard that Quicktime Player was a good way to do it, so I tried some stuff from people on Apple ...
0
votes
0answers
50 views

How to pause Applescript when another process is not responding to system events?

I would like a Applescript to pause while a specific process/script/app is not responding (temporarily or permanently) to system events, and to start-up again when the other process is back. In ...
2
votes
1answer
43 views

Launching apps behind the lock screen?

I need to run an application behind the lock screen, e.g., just as Time Machine or Sophos antivirus (and others) can run when the screen is locked. Specifically, I would like to schedule an ...
1
vote
1answer
57 views

AppleScript: move a folder to library (to root) in iTunes

Does anybody know how to move some folder to library playlist in iTunes? I can move some folder to another folder using the following script: tell application "iTunes" move folder playlist "3" ...
1
vote
0answers
25 views

Email message duplicated from AppleScript

I'm using the following AppleScript within a rule to auto forward emails to Evernote. The issue I'm seeing is the email is duplicated in Evernote. Within Evernote the note contains the email twice. ...
0
votes
2answers
47 views

What is the default function for a play/pause media key?

I have a Microsoft Natural Ergonomic Keyboard 4000. It has a button labelled play/pause. When I have no keyboard drivers installed, the way the button behaves is by toggling playing and pausing in ...
0
votes
0answers
15 views

AppleScript application works not as UIElement

my AppleScript that contains on quit-Handler works if it is visible. If I add to the Info.plist-file of the application the Application is agent (UIElement) with YES. Then the application doesn't ...
0
votes
1answer
50 views

Applescript or Shell rename a file?

The following is the code I have, however, it doesn't let me choose the extension I want to save it as. How can I save the file as a ".plist" ? do shell script "echo '{ Filter = { Bundles = ( \"'" ...
1
vote
1answer
22 views

AppleScript - Add userinput to text file?

How can I add a user input variable to a text file? This is what I have right now: -- ask user display dialog "Enter Cheat" default answer "99 Gold, super health, unlimited Grenades.." set cheat1 ...
1
vote
1answer
33 views

Set Brightness to Full on Boot (MacBook Pro)

I frequently have the problem where my laptop's screen is too dim prior to login and I can barely tell where my account or the mouse is. Is there a way to set the brightness to maximum on boot before ...
0
votes
1answer
30 views

AppleScript: Get list of 15 most recent files in directory

I need to build a string containing the filenames of the 15 most recent files (by modification date) within a directory. Delimited only by a space: file1.jpg file2.jpg file3.jpg I'm using ...
0
votes
1answer
14 views

Applescript causes long error messages to be logged in system.log

I have this very simple script... tell application "System Events" set activeApp to short name of first process whose frontmost is true end tell tell application activeApp repeat 5 times ...
0
votes
0answers
22 views

How do I use Applescript to reply to an email?

Specifically I'm looking for a simple tweak in the Mail app. I have a rule set up to "Reply with text" to certain emails that come in, but one source in particular (Trulia) emails me messages from ...
0
votes
1answer
42 views

Applescript to Heart or Love or Favorite song

Anyone know if there's away to heart/love/favorite a song in the new iTunes via applescript? Basically I want the ability to heart a song from Apple Music without switching back to iTunes.
2
votes
1answer
59 views

Shell Script Commands Work Fine in Terminal But Not Via AppleScript

I have two commands that I need to run through the Terminal. They are cd /Users/[my name]/Desktop and curl 'www.google.com'>google.txt. When running these directly in Terminal they work just fine. ...
0
votes
0answers
32 views

Count of windows with AppleScript on every desktop

I would like to get the count of the windows on every desktop. With the following code I get only the count on the current desktop. tell application "System Events" set allApplications to (name of ...
0
votes
2answers
53 views

Applescript “expected then but found identifier”

At present, I have a very simple bash script which calls osascript -e a bunch of times; it looks like this (newlines added for readability): #!/bin/sh osascript \ -e 'tell application "Terminal" to ...
0
votes
0answers
48 views

List all programs without any window and kill them

has anyone an idea for an AppleScript that checks the number of windows of all applications and kills programs with window count 0? Thanks a lot!
0
votes
0answers
45 views

Run Applescript when Finder's 'Open new tab' or 'Open new window' is executed

I would like to run an Applescript when I either open a new or additional Finder window or when I open a new tab. Perhaps with Automator? How would I achieve this? FYI, El Capitan has a Finder ...
1
vote
0answers
40 views

Set environment variable for iCloud Drive path

Foreword Setting env vars on Yosemite seems to be really a pain, but I've managed doing it thanks to this clever way: ...
1
vote
1answer
40 views

Applescript Calculate Run Time of a Command

How would you calculate the time it took to run a command? Specifically, I want to know the time it takes to return a value in a Shell command. I wrote this up, would it work? (Psuedocode) ...
0
votes
0answers
20 views

Applescript to read unread notifications from Notification Centre on an arduino input

I am using applescript on Yosemite to read out (say) unread notifications from the notification centre. The action is triggered on an arduino input. While I can trigger the notification centre I am ...
2
votes
1answer
85 views

How to capture mail.app message url that will remain persistent when message is moved?

So mail.app has this wonderful message:// URL scheme, which works great—until the message is moved. Then links created sometimes work—and sometimes don't. I can't figure out the difference. So my ...
0
votes
1answer
14 views

Re-numerate selected tracks in iTunes

I often do the same job: select each track in selected set of tracks, open Properties of track and set the number of the track. I am just wondring may be there is a script or plugin for iTunes to ...
1
vote
1answer
36 views

Need help with small AppleScript

I'm on Yosemite 10.10.4, Mac Mini. I have a small Bash shell script to start Quake3 Arena in Wine. It works fine. #¡/bin/bash cd Desktop/Quake3ISO hdiutil mount "Quake 3 Arena.iso" cd Quake3 wine ...