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

Only copy files modified after certain date, and maintain file structure

So, I had to do some work on a drive that's used where I work. It's an important drive, and couldn't be down while I did this, so I copied the files to a new drive for use while the other was ...
0
votes
0answers
19 views

Possible to create a hyperlink to a specific contact in Contacts.app or specific event in Calendar.app?

Is there a way to create a link/hyperlink to a specific contact in Contacts.app or a specific event in Calendar.app? I'm thinking of something along the lines of a contact://contact-guid or ...
2
votes
1answer
85 views

Remove folder name from file name based on existing Apple Script

so I have this apple script here that I used to insert the folder name into the front of all the files in the folder. The script is able to run through every single folder and target all the files and ...
0
votes
2answers
2k views

How to archive mail in Outlook 2016 with a shortcut?

Outlook 2016 has removed support for AppleScript. I used to use a script to move my mail to the Archive folder on Ctrl-A. How do I restore that functionality?
5
votes
1answer
795 views

Applescript: “can't get tab group 1 of window” (El Capitan)

The following is an applescript that I use to change audio output devices: tell application "System Preferences" activate set current pane to pane "com.apple.preference.sound" end tell tell ...
1
vote
1answer
77 views

Is it possible to read the accessibilityLabel attribute of an item using AppleScript?

I'm trying to extract the list of cookies according to Safari. I have the following code fragment: tell application "Safari" to activate tell application "System Events" to tell process "Safari" ...
1
vote
1answer
29 views

Applescript to check for the existence of a file

I record radio programs during the night and then run an applescript to rename the files. I have the script working unless there is no file named that I am attempting to call and rename. Here is my ...
0
votes
0answers
64 views

Apple Script to Send Message to Most Recent “Messages” Conversation

Starting with the following line: set _message_ to "Example message" I am looking for a way to send _message_ to my most recent conversation in Messages. This means the conversation I most recently ...
0
votes
3answers
163 views

Applescript Won't Invoke Shortcut Command

I have a long TextEdit document I frequently open (via a keystroke, thanks to Alfred). It contains many non-standard spellings, so I de-select "Check Spelling While Typing" (though I want spell ...
1
vote
1answer
323 views

Automating numbers, Exporting the file as an excel document

I have recently acquired a Macbook Pro (OS X Yosemite 10.10.4). I find the Numbers application satisfactory to work with, but I save the file as an .xlsx file after I am done. I need to make changes ...
4
votes
1answer
77 views

Write an AppleScript to create a web link on the desktop

I'm helping a visually impaired friend learn how to use her Mac. She's using the built-in screen magnifier, which is working great. She likes to access websites (mainly TV streaming services) via ...
0
votes
1answer
162 views

Applescript to move focus to active or next window

I am trying to implement a "Command-tab" style setup that works only within a specific space. For most apps, "Ctrl-F4" which is "move focus to active or next window" works correctly, but for ...
1
vote
0answers
47 views

How to make an AppleScript that edits the next note in Mac Notes

I want a shortcut to edit the next note in Mac Notes. Since there is no menu alternative for this I guess I need to create an AppleScript for it. I've tried to use the Notes library in the AppleScript ...
0
votes
0answers
37 views

Terminal: executing a batch of commands from dynamic locations

I'm trying to restructure a library of audio files and I've been trying to do so using Terminal. See the folder structure in the attached image. There's a couple of things I want to do: 1) Remove ...
0
votes
1answer
141 views

How to get the window id with title 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. tell application "System ...
0
votes
1answer
295 views

Drag to convert Automator Action into Applescript

In Automator, there is a way to quickly convert an Action into its equivalent Applescript in Automator, I think by dragging it in some tricky way. I saw this some time ago but have now forgotten. ...
0
votes
0answers
30 views

AppleScript runs twice?

This script should say a b just once but many times it says a b a b. I think this has something to do with Saved application stage. I emptied Saved application stage folder for this script then ...
0
votes
2answers
173 views

Selecting Random File in AppleScript

I’m trying to make a script that can select/display/open a file randomly from a folder and its subfolders. The following script: tell application "Finder" get some file of (folder ...
1
vote
0answers
62 views

how to capture screen excluding a window with screencapture?

The command line utility screencapture can capture the desktop and a specific window with the commands screencapture Desktop.png and screencapture -l$(osascript -e 'tell app "Safari" to id of window ...
0
votes
0answers
296 views

How do I connect a VPN connection using AppleScript?

The Problem A number of defined Applescripts out there to tell your VPN connection to start connecting. The problem is, a lot of these seem to be designed with older versions of Mac OS in mind. This ...
2
votes
1answer
139 views

Find specific attached disk, not volume, by Applescript

I have a script I use to format any inserted SD card, copy data from specific folders to it, then eject. Each format/copy is triggered manually, as part of a batch process involving maybe a hundred ...
0
votes
2answers
76 views

Is there a way to fetch the icon file path of an application using AppleScript?

I'm currently writing an Alfred workflow in which I want to retrieve the icon file path linked to an application. Is there any way to do so natively using Apple Script ? tell application "Finder" ...
0
votes
1answer
57 views

set position {0,0} of element accessibillityTitle via Applescript

I have a UI element called accessibillityTitle with value Layers and I want to position this element in the top right corner, but I don't know how to acces it via Applescript. I have found the element ...
1
vote
1answer
87 views

AppleScript to export script editor script as application

I have a binary that I want wrapped up as an Application, so I thought this was a good use case for AppleScript. I want to automate how Script Editor lets you export an AppleScript as a .app bundle. ...
0
votes
1answer
318 views

Close all programs after 1min without user interaction

I work at a store, which sells Apple computers. I’m trying to find a way to close all open programs after a few minutes. It’s because of our Shop Demo Account for customers. After opening all ...
1
vote
1answer
98 views

Automating Terminal Commands with AppleScript

I have an Arduino-based device (www.picobrew.com) and needs firmware updating. The company wrote a little app to do it for Windows users, but us OS X users are out in the cold. Fortunately, we were ...
0
votes
1answer
83 views

Need to automate copy / paste graphic selection from Preview to Google Doc

I need to paste sequential rectangular selections from a PNG opened in Preview into a designated Google Doc. I suspect AppleScript is the best candidate for this, but I'm open to using a more ...
0
votes
0answers
55 views

How can I query repeating items in Calendar with AppleScript?

I want to run an AppleScript to check my calendar every sunday for the next week, and if there is a repeating all-day event, put it as a note into Evernote. I successfully wrote the script that can ...
1
vote
0answers
80 views

AppleScript to extract email address from body of email and send auto response?

Is there a way with AppleScript to extract a contact link in the body of an email and send an auto response with apple mail? (I'm running Yosemite) I would like to auto respond to leads I receive ...
0
votes
1answer
90 views

Convert image type and save to relative folder with automator

I found a question and working answer here How to create an Automator service to convert images from one file type into another file type using the right-click contextual menu? but it is saving the ...
1
vote
3answers
54 views

How can I monitor the size of a file?

I run a particular abandoned open source project (StreamBaby) on my home media server, a Mac Mini. It's awesome but has one unfortunate issue which occasionally causes the app to generate an ...
0
votes
1answer
43 views

Need an Applescript to handle specific incoming mail.

Here's what I'd like the Applescript to do: upon receiving an email (I'm using Apple Mail) from a specific address, I'd like, firstly, that email to be deleted (not just moved to trash), and secondly, ...
2
votes
1answer
64 views

Script OSX Color Picker to choose a specific color and exit

Looking for a way to AppleScript the native (?) OSX Color Picker displayed in Evernote so that I can set a specific color and exit. Use case: Would like to create scripts to mark selected text red, ...
2
votes
1answer
38 views

How to get Apple Mail badge (n. of unread messages) from script?

I'd like to know in a (applescript|bash|python|whatever) script, running on my Yosemite OS X, the sum of unread messages in all accounts of the Apple Mail application - in other words, the same number ...
0
votes
0answers
21 views

Unable to adjust height of MoneyWell app after using full-screen mode

After I use full-screen mode, I cannot adjust the size of MoneyWell's window with AppleScript. It will change location, though. This is one of a few scripts I tried. Any suggestions? tell ...
0
votes
0answers
39 views

How to use osascript to tell the Microsoft Excel to open a specified xlsx file?

I want to use osascript to open a data.xlsx file and switch to its sheet with a name of sheet2. What should I do? Is there something like this? osascript -e 'tell application "Microsoft Excel" to ...
0
votes
1answer
328 views

How to use osascript to open the Terminal App in a new window and make sure it's on the top of all other windows?

I found a way to open Terminal.app very usefully as: osascript -e \'tell application "Terminal" to do script "cd myfolder && ./something.sh param1"\' If it were executed from a terminal ...
0
votes
0answers
18 views

Last sent e-mail from Mail.app

Is there any way to get the last sent e-mail from Mail? It can only access the top level sent mailbox. tell application "Mail" set mabo to the sent mailbox set selected to messages of mabo ...
1
vote
0answers
129 views

How to restart Safari (also clearing history and cookies) after being inactive (time based)?

I'm working on a Mac with parental control and it's supposed to be a kiosk Mac. I'm wondering if there is a similar Applescript that can tell Safari to restart after given for example 45 minutes? Is ...
0
votes
1answer
52 views

Applescript to keep a button pressed until I press it again?

I need an extra modifier key which acts kinda like Capslock by using AppleScript - or maybe you've got another proposition? I would bind it to some key combination in BetterTouchTool.
0
votes
1answer
76 views

Why is bash echoing instead of running Apple Script

I have a function in my .bash_profile that should allow me to add startup items. The only issue is this echo's a string instead of running the Apple Script. This is my function function ...
1
vote
1answer
122 views

How to pass user input to Apple Script then execute?

How do I configure Automator to ask for a text input (example: enter website url) and pass the answer to an AppleScript that executes this command: video-dl (user input) So, this would be executed ...
-1
votes
2answers
80 views

How to list files of any installed app in the MAC programmetically?

I am making MAC app in which I want to list of files / folders related to any installed app in the mac. For example; I want to get list of all the files and folders of Skype app installed in my MAC ...
1
vote
1answer
423 views

Volume Overlay Displaying Incorrectly/Not Centered

So basically my macbook pro (mid 2010) was acting funny (shutting off when left corner was tapped/bumped, high fan when no activity, etc.), nothing helped so I reset the SMC (I think that's what it's ...
0
votes
0answers
34 views

How to detect if a program executes correctly or with errors using applescript

I am using Hazel and Abbyy Finereader to automate OCR of PDFs. I am using the following AppleScript (found on the NoodleSoft Forums) to run Finereader. I'd like to know if it is possible to enhance ...
1
vote
0answers
17 views

Dragon Dictate pressing space bar when not recognizing command

I'm using yosemite 10.10.5 with Dragon Dictate 4 and 5 I had this problem. Whenever I say a word that is not a command the what appears to be space bar is pressed. In turn, paging down or opening ...
0
votes
0answers
39 views

Manipulating messages in Outlook 2011 from on IMAP account with applescript

I am currently using a great applescript that deletes duplicate messages from whatever currently selected folder. I use it mostly on IMAP folders to avoid downloading duplicate messages to POP ...
1
vote
2answers
329 views

How to click the OK button in Google Chrome alert, using AppleScript

I am using AppleScript with Google Chrome to automate a tedious process on a website. In certain conditions, the website has an alert popup to notify the user of an issue. This prevents the rest of ...
0
votes
0answers
113 views

Launchd Applescript Timeout Error

On Yosemite 10.10.5, I have an Apples Script application that runs and completes as desired under 2 of 3 conditions. The application is set to launch, by launchd plist 3 times per day at 7:05am, ...
0
votes
1answer
155 views

Applescript to change subject line

I have been looking up for the last two days and found a few applescripts that claimed to change the subject lines. But none of them seem to be able to change/set the subject line. What do you guys ...