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
1answer
108 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 ...
4
votes
1answer
56 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 ...
1
vote
0answers
44 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
32 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

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. ...
1
vote
1answer
124 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
0answers
27 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
95 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 ...
0
votes
2answers
57 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" ...
1
vote
0answers
55 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 ...
2
votes
1answer
100 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
0answers
256 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 ...
7
votes
8answers
4k views

Sending push notification to iPhone via AppleScript

Is there any combination of iPhone and/or Mac apps that I can use to send a push notification to my iPhone? For example, let's say I want to create a service (invoked via (Application Name) > ...
0
votes
1answer
243 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 ...
6
votes
3answers
4k views

How to disable individual USB ports by script?

I am looking for a script which will allow me to disable one specific USB port on my Mac mini. It would only serve a purpose if it works in real-time and didn't require a reboot. I've found scripts ...
1
vote
1answer
53 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
60 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 ...
1
vote
3answers
544 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 ...
0
votes
0answers
46 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 ...
3
votes
3answers
7k views

Applescript click automation in Google Chrome browser?

Hello fellow programmers! I would like to save some applescript code as an application, so that when I open the application it will go to Google Chrome and answer an incoming call in Google Voice. I ...
2
votes
1answer
92 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 ...
0
votes
1answer
66 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
0answers
71 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
36 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, ...
1
vote
3answers
48 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
3answers
1k views

AppleScript for iCal events from Address Book entries

I want to create a script that creates alarmed events in iCal for birthdays of people that I have in my address book. Unfortunately, I am very bad working with AppleScript. Below is the outline of ...
2
votes
1answer
36 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 ...
2
votes
1answer
48 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, ...
0
votes
0answers
20 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 ...
5
votes
1answer
2k views

enabling/disabling Internet Sharing with terminal in mac osx 10.9.2

The problem is setting the internet sharing with CLI instead of GUI in Mac OS 10.9.2 I followed instructions as per this thread Start/stop internet sharing from a script? including both CLI and ...
0
votes
1answer
154 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
35 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
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 ...
0
votes
1answer
108 views

Prevent VPN Disconnection message OSX

When my computer wakes from sleep, it tries to reconnect to my VPN network before the Wifi connection is fully established. The result is that nearly every time I get this message, "You were ...
1
vote
2answers
855 views

How to make Rsync copy alias files?

System specs: 2011 iMac, OS X Mountain Lion 10.8.4 I have come to understand that Rsync does not handle Mac Alises properly, and have now discovered that hundreds of aliases I've previously copied ...
1
vote
0answers
90 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 ...
1
vote
1answer
2k views

Automator workflow or AppleScript to close Safari after a period of time

I would like to create an Automator workflow (or some similar function) that will close down Safari after a specified period of time. For instance, I simply want to run Pandora in Safari during the ...
1
vote
2answers
494 views

AppleScript: Open a new window in current space without switching to active window in another space

I want to have an application open a new window in the current space without switching to a space in which a window is already open, but I want to keep the When switching to an application, switch ...
0
votes
1answer
68 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
votes
2answers
61 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
67 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
vote
1answer
188 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 ...
1
vote
1answer
33 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
2answers
268 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
30 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
16 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
31 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 ...
0
votes
1answer
97 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
0answers
86 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, ...
1
vote
1answer
29 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 ...