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
10 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
37 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
20 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 ...
0
votes
0answers
9 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
0answers
19 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
10 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
17 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
24 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
46 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
24 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
1answer
27 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
43 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
31 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
23 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
22 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
15 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 ...
0
votes
0answers
13 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
0answers
9 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 ...
0
votes
0answers
10 views

Open Word Doc with Pages using Applescript

How can I get the following to work in Pages? I get an error message saying the file can't be opened but if I change the path to a .pages file it works fine. tell application "Pages" activate ...
0
votes
0answers
42 views

Automator/AppleScript: Sync 3 folders when an item is added to one

Background I'm fairly new to the Automator/AppleScript tools. There are 3 folders on the Mac and external hard drives that should sync when a file is added to one. So, for example, when I add a ...
1
vote
1answer
23 views

Launching Character Viewer (aka CharacterPalette) from command line

So, recently I have being using the Character and Keyboard Viewer a fair bit and set up simple Alfred keywords that toggle the launch/quitting of these apps so as not to have to leave the keyboard. ...
0
votes
0answers
28 views

AppleScript choose file dialog box with default location not working

So there goes four hours of my life that I will never get back. I'm trying to do something seemingly simple... I want to open a file select dialog box and specify the default location. I actually ...
0
votes
1answer
20 views

Applescript to read facebook notifications

I am very new to applescript as well as programming. I am trying to find a way for applescript to access my facebook unread notifications and whatsapp web unread chats and read it out to me. I can ...
0
votes
2answers
32 views

Dock shortcut for an interactive bash script

I'm new to OSX and all I want it an application shortcut in Dock that opens the terminal and types the first command and waits for me to provide the password. Here is the script I want to run: ...
0
votes
1answer
26 views

osascript Expected end of line but found class name?

Not really sure what its expecting here, I assume its around click button though. This used to work on 10.10.3, but seems to have stopped on 10.10.4? Script function AcceptSecurity () { osascript ...
0
votes
0answers
41 views

Automator action to Search with YouTube (Safari)

There is a contextual menu that allows user to search highlighted items with Google. I'd like to create a process that searches with YouTube with applesccript(automator). I tried doing something on ...
0
votes
1answer
23 views

Applescript: Duplicate selection (folder) to desktop and moving the folder to a different location

First of, i'm an applescript noob;-) What I'm asking for is simple but nearly impossible for me to execute. See the script below. tell application "Finder" set selected_items to selection ...
0
votes
0answers
29 views

Toggle Show Date and Time via AppleScript

How can I toggle the "Show date and time in menu bar" option via AppleScript. I'm using OSX 10.10.4. I am looking for a working example in AppleScript.
2
votes
1answer
25 views

Adding content from mail to Excel using Applescript

I have gone through and used some great code form the these forms for Adding content from mail to Excel using Applescript. I am nearly there but have one more question. I have the following layout of ...
0
votes
0answers
14 views

Create directory inventory when ejecting

I use UnDock Now! to eject external hard drives, which allows running AppleScripts before ejecting. I would like to have a running inventory in a text file of all of the folders and filenames that ...
0
votes
1answer
30 views

Applescript - Get information from terminal command

I'm creating a little script to allow quick changes to the network settings of my Mac. I have got it all working, but I wanted to be able to see what the settings are before I change them in the first ...
0
votes
0answers
71 views

Replace iTunes playcount with previous library using Applescript loop

After updating my iTunes library to iCloud, the play count of some has been messed up. I was thinking of fixing the missing data by using an Apple Script loop. The loop should scan the playcount of ...
1
vote
1answer
39 views

Applescript - AppleEvent handler failed on set properties {visible messages: }

I have the following applescript working under Lion, but it returns this Error: -10000. Mail got an error: AppleEvent handler failed. error under Yosemite. try tell application "Mail" set ...
0
votes
0answers
15 views

Use Automator to select camera in Quick Time Movie Recording

I'd like to create an application shortcut to directly show the screen of my connected iOS device using Quick Time's "New Moview Recording" function. I am already able to create an Automator script ...
0
votes
1answer
65 views

Need assistance with AppleScriptObjC conversion from AppleScript

I need to preface this with the statement that I am not a programmer, so I need to be talked down to. I have done what I described below using guides and lots of trial and error I have a functioning ...
0
votes
1answer
20 views

Applescript to emulate key strokes [duplicate]

I want applescript to input into microsoft excel "No, (tab, tab again), Yes". I can't seem to make this work. I would preferably like it to start whenever I press a hotkey or something, but having to ...
1
vote
1answer
27 views

How do I use a numerical variable and a loop in automator?

Since scripting is not that powerful in case of Preview.app, I am trying to find the solution with Automator. Here's the problem: I've got a protected pdf file of 130 pages. It happens that I can't ...
0
votes
1answer
55 views

How to strip file extension in applescript (In Automator)?

EDIT: This is the working code for an AppleScript Automator service to encode (ffmpeg) a user selected file to a user selected directory, keeping the the original file name with a new extension.: on ...
0
votes
2answers
39 views

How to mount and name a volume if it's not already mounted with a startup script

I'm trying to do something I thought would be simple, but after researching it I feel like I'm half way towards shaving a yak, so I'm asking for advice. I want to create a script that lets me and my ...
0
votes
1answer
23 views

how can I use applescript to type?

how can I use applescript to type in a specified area on the screen? I've tried the 'keystroke' command, but it doesn't seem to work. also, how can I use applescript to display an image? thanks a lot ...
0
votes
0answers
21 views

Applescript - How to Create a Contact IN a specific Account?

I am using Applescript on Yosemite 10.10.4 to create contacts in the contacts app. I have two iCloud accounts configured on my Mac. One personal (The "main" iCloud account) and one business. ...
2
votes
1answer
40 views

AppleScript: 'exists' returns true every time

On every exists in AppleScript the result is true. For example: set a to (POSIX path of (((path to home folder from user domain) as text) & "skfhshfkh:" & "hfjhsfhsj:")) if exists a then ...
1
vote
1answer
41 views

Turn Wifi off/on with a single key?

Is there a way to assign the WiFi on/off function to one of the function keys like F4 that I otherwise never use? I assume Applescript would be required. However I may want to use a BASH script ...
-1
votes
0answers
29 views

Applescript click button that has no title

Hi I would like to tell the application to click the Configuration button that has the value of 1 (top left) I have locked the accessibility inspector on it, it has no title and I dont know which way ...
0
votes
2answers
41 views

Open iMovie with alt down from AppleScript

How to open iMovie with alt from keyboard with AppleScript?
1
vote
2answers
55 views

Get part of result of command line in OS X

I would like to use the following command line to get the current Wi-Fi channel. /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I I would like to use ...
0
votes
1answer
108 views

AppleScript - GUI Scripting and setting checkbox, radio button and field values

I'm working on an GUI scripting AppleScript that will, for the open FileMaker Pro Advanced document, go to the File menu and select the File Options dialog box, then set some checkbox/radio button and ...
0
votes
0answers
15 views

AppleScript and Configurator

I have written a bash script to modify a mobileconfig file (iOS profile in a xml-plist format) as per this link and I am now in the process where I would like to interact with Configurator via ...
0
votes
1answer
32 views

Get terminal application name from shell

I am used to my osascript aliases. In particular, I have nx for opening new tab and closing the old one. However, my scripts use application name to send keyboard signals to it. Instead of writing it ...