Questions tagged [applescript]

AppleScript is a proprietary programming language in macOS to control and exchange data with applications.

380 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
73 views

AppleScripting safari - getting dynamic dropdown menus to notice a change

I'm trying to automate a repetitive process on our company's expenses claim intranet site. The task requires clicking some buttons (easy to automate), and then selecting from a dropdown menu (which is ...
1
vote
0answers
115 views

Applescript Pages: How to tell thisDocument to make new page with template page

I have created a Pages document with a template, and I want to add a page to the document using one of the pages in the document's template. Something like: tell thisDocument to make new page with ...
1
vote
0answers
74 views

Why does an applescript not detect success after creating via dragging from a “watch me do” recording?

Background: My goal here is to gather connection speed data that my ISP will accept so I can demonstrate dramatic drops in connection speed lasting 1-5 minutes that I've been experiencing immediately ...
1
vote
0answers
396 views

Has Mojave broken Applescript: set volume output volume?

set volume output volume 25 I've used that simple code for well over a decade to set my Mac's audio to a specific volume (25, on a scale of 0-100), but since upgrading to Mojave, running it causes no ...
1
vote
0answers
125 views

Keyboard shortcut or AppleScript to move current tab into a new window

Recent versions of macOS bring tabs to applications that didn’t seem to support tabs before (e.g. Anki flashcards), via the Dock preference to always prefer opening things in tabs. Stock apps and ...
1
vote
0answers
111 views

Formula to calculate the sum of timecodes - AppleScript

After extensive research on the Internet I could't find a decent formula to calculate (add) timecodes, so I'm building my own script from scratch. So far I can get a pretty decent result, however I'm ...
1
vote
0answers
53 views

Splitting Zip Files Based on Number of Files, Not Size

I'm looking to setup an automater script on my Mac. On a daily basis I'm compressing thousands of files into groups of 75 files by manually selecting the 75 and compressing them. Is there a way to ...
1
vote
0answers
747 views

Using Applescript to execute Javascript in Chrome and set a value to a variable

I'm building a service through Automator. So I'm trying to execute this bit of Javascript in Chrome and set the clipboard to the value of one of the variables. Essentially it is grabbing the contents ...
1
vote
0answers
132 views

AppleScript handle QuickLook on itself?

I've created a very simple AppleScript app which currently, when run, displays a different image from the desktop depending on which day of the week it is as seen below: set currentDay to weekday of (...
1
vote
0answers
139 views

Setting alarm on iCal with Applescript does not work with iCloud calendars

This script, which adds an event to the Calendar, works with the calendars that are local to the Mac that it runs on. When used with iCloud calendars, it seems that the alert is set for a few seconds ...
1
vote
0answers
176 views

Run an AppleScript .app from Excel 2016 button on Mac

I have an AppleScript .app file that opens a Word document. I have created a button in Excel 2016 that assigns a file name to a variable. I would like to be able to pass this filename to an ...
1
vote
0answers
202 views

How to create a Windows Compatible Encrypted disk image?

I need to send a file over Email securely. My idea was to use a Disk Image containing the file. Unfortunately, the person who I am sending the file to has a PC running Windows 10. I need a way (...
1
vote
0answers
139 views

Applescript and javascript document.querySelectorAll click on a link

I'm trying to click on the ViewMYMachines link, I'm not sure how to proceed, I suppose I have to use document.querySelectorAll here is the link : <a data-auto-test-id="ViewMYMachines" href="/...
1
vote
0answers
87 views

How to close a mission control space using hotkey?

Using "Better Touch tool", I have a hotkey set to "Add New Space To Mission Control". I would like to create the inverse of this and set a hotkey to close the current space. Specifically, I would like ...
1
vote
0answers
489 views

Batch Rename files based on list of new names, but existing folder structure must be maintained

I have a group of folders, each folder representing a different product that my record label has released. Within each folder are the .wav audio files of the tracks that make up that release. The ...
1
vote
0answers
561 views

Applescript / Google Chrome : open a link in a new tab

I use this to open a link (the url is unknown): tell application "Google Chrome" tell tab 1 of window 1 to set OpenfirstTab to execute javascript "document.getElementById('TransactionHistory')....
1
vote
0answers
45 views

Automator Service - prevent multiple calls

I might need some help. I have an Automator Service / Script, which does basically just toggle play/pause in some application. I call this script via Shortcut. I am using this to play/pause Spotify, ...
1
vote
0answers
363 views

Integrate structured editor with Devonthink

I am trying to use Devonthink for more use cases than I did before. What is holding me back from making it my general note-taking tool is the editor situation, and I wonder if it can be improved. ...
1
vote
0answers
117 views

Run Applescript while in full screen without going back to the desktop

When I run an AppleScript from an application in fullscreen, for example Google Chrome, the system will change the focus to the desktop and leave the application was is in fullscreen. tell ...
1
vote
0answers
141 views

Workflow works from Automator but generates timed out error when run as service

This Automator workflow works perfectly when run from Automator. However, when launched as a service from a keyboard shortcut, the script generates a timed out error. The keyboard shortcut is valid. ...
1
vote
0answers
197 views

Add track to currently playing playlist in iTunes using AppleScript

Using AppleScript, I can add a track to a playlist by using a command something like this: duplicate myTrack to playlist "myPlaylist" which works fine. However, if the playlist is currently playing, ...
1
vote
0answers
252 views

script to get PDFpen to OCR multiple PDFs at once

I'm trying to create a simple Automator workflow to find all non-searchable PDFs then OCR them with PDFpen. I can't make much sense of the one or two other posts here (like this one), nor do I have ...
1
vote
0answers
143 views

Applescript for tagging 4GB of PDF files

I've only recently come across automation world and realized that it could help me solve one big problem. I've roughly 4 GB of PDF files in my computer, mostly from the university, they range from ...
1
vote
0answers
234 views

help in writing script to mount external hard drives

Using: MacBookPro (Retina, 15-inch Mid 2015) macOS HighSierra V 10.13.2; Internal HD has 250GB. In order to save space in my HD-internal, I have 5 USB connected external disks which are for backups ...
1
vote
0answers
235 views

Find out the PID of an application

I am developing apps with Unity 3D, and often have several instances of the program open. When I go to debug my scripts, Monodevelop (the script editing and debugger tool) shows me a list of all open ...
1
vote
0answers
410 views

Security & Privacy/Accessibility not updating permissions

I've got a bit of applescript that I wrote that presses a couple window buttons on screen for me. On use, I get a pop-up saying I need to grant permissions in 'Security & Privacy -> Accessibility'...
1
vote
0answers
77 views

Trigger script on specific webpage loading

My mother has a the 30-inch LED Cinema Display, which is a bit too large for her everyday use. She prefers to use it in 1680x1050 or 1600x1200 modes, and can then switch to 1920x1080 for watching ...
1
vote
0answers
64 views

How to make sections in the Script Editor menu

I'm aware that I could just put a folder in the Script Editor menu and thus make sub-menus. However, I find that just a tad annoying. If I put a script in Scripts/Applications/X, I'm able to get a ...
1
vote
0answers
101 views

Applescript: Keynote 6.6.2 start presentation

I checked this website: https://iworkautomation.com/keynote/document-play.html and I tried this code to start a Keynote presentation: tell application "Keynote" activate if playing is false then ...
1
vote
0answers
309 views

AppleScript to rename subfolders

I have a file structure for photos which is Year >Date, then within each date folder I have RAW images plus a folder named 'jpg', which contains jpg copies of the RAW files. I need to move the jpg ...
1
vote
0answers
111 views

Droplet won't start with multiple file types

I wrote a droplet to hack a set of MS Word files. I have been using the Script Editor. In one incarnation I used the 'recursive file processing droplet' and in another I hacked a bit from a script I ...
1
vote
0answers
162 views

run AppleScript on fullscreen without focus back to the desktop

When I run an AppleScript and I am in fullscreen, it's always bring back to the desktop. as a work around I use "tell front window of application "Google Chrome" activate" but that still very ...
1
vote
0answers
99 views

How to set the Escape key to quit a Service?

I want to be able to hit the Escape key on my keyboard to stop a Service (that is comprised of a "Run AppleScript" action in Automator) while it is in the middle of running. Incidentally, if one hits ...
1
vote
0answers
68 views

Two variables contain the same AppleScript object, yet they are not equal, why?

I don't understand: tell application "Mail" set A to first mailbox of first account set B to every mailbox of first account set C to first item of B log C is A -- returns true, as expected repeat ...
1
vote
0answers
45 views

I'm trying to automate some steps I perform in Pages

I use Pages to write my invoices and save a PDF version as well. Currently, when I'm done, I press Command-S to save, Command-P to bring up the print dialog, select "Save as PDF…" from the PDF menu ...
1
vote
0answers
444 views

How do I show the volume control overlay using Applescript?

I use BetterTouchTool and Applescript to have hotkeys for specific functions. For example, I have Command F11 set up to set my Mac's volume to 19, which is basically the same as 3 dashes on the ...
1
vote
0answers
321 views

Strange problem: Mac OS Sierra (10.12.1) open or save file dialogs are not appearing (in any app)

Because of some overly-enthusiastic self-written clean script on my Mac I have run into a very specific problem: all my applications are refusing to open 2nd windows, e.g. 'save file', 'open file', '...
1
vote
0answers
280 views

Unable to run secure remove (srm) command from AppleScript

I am unable to run the command srm in macOS 10.12, Sierra. I can run the command in Terminal.app but not from within an AppleScript. This command works: srm -rf /Users/Jack/.Trash/ This command ...
1
vote
0answers
163 views

Use BetterTouchTool keyboard short cut to find all folders in Finder with the tag “red”

I use the tag "red" to tag all folders and files on my machine which I want to quickly access. I am now trying to setup a keyboard command e.g. ctrl+cmd+opt/alt+R to open in Finder all my files and ...
1
vote
0answers
218 views

Mail.app - messages deleted by applescript reappear later in the day in the inbox.

I use a set of applescripts to help report junk mail to spamcop. The first script, after sending the raw source of the selected message to spamcop, marks the message as junk and then deletes it. ...
1
vote
0answers
660 views

Clicking on a button in Safari using AppleScript

I know there are several topics with tutorials for clicking links/buttons on webpages with AppleScript, but unfortunately none of them worked for me on this specific website. The website contains ...
1
vote
0answers
287 views

AppleScript : Safari : Open link in a new tab (Command+Click)

I need applescript to open a link listed on a page in a new tab here is the page HTML <form name="k_1_1_1_1_7_0_7_7_1" method="post" action="/WebObjects/WEBTOOLS.oa/o/GdghsdhHSRHdsh/10.56.14.55"&...
1
vote
0answers
149 views

Run Automator script when new files are added

I'm trying to make an automator script to import photos in Photos.app that are in my DropBox folder. Nothing spectacular you'd say - true. But I can't get it to work. On a change in the folder, the ...
1
vote
0answers
3k views

Curl terminal command syntax from Applescript

I want to execute a curl command in Applescript that does the following (per this SE question/answer): https://superuser.com/a/1054803/471181 ...Do an HTTP POST of the contents (as a string) of a ...
1
vote
0answers
521 views

How to define keyboard shortcut for “Save to your Music” Functionality for Spotify

I really love the Spotify app. When I like some songs on Spotify, I'm using "Save to Your Music" to add songs to my Spotify library. But this requires switching applications and using the mouse, so I ...
1
vote
0answers
506 views

Script to start my VPN if I'm connected to a specific Network / SSID [El Capitan update]

I'm searching an AppleScript to automatically start my University VPN if I'm connected to the University network. I already found some solutions for older OS X Versions, but they're not working ...
1
vote
0answers
142 views

Copying a path of the app to a new directory?

I was wondering if someone could help me make an AppleScript that copies the app the script is into another location. So, this is what I tried... (Please don't say anything since I am new at ...
1
vote
0answers
1k views

Error executing AppleScript through Launchd - “Service could not initialize”

I've written an AppleScript that turns our CenturyLink modem's wireless radio on or off. It works when I run it manually with osascript, but now I'm trying to get it set up on a schedule with Launchd. ...
1
vote
0answers
354 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 ...
1
vote
0answers
591 views

I need to batch move files from one location to another, and put them in pre-existing folders with the same first 7 characters

I am looking to automate moving large amounts of files. Basically I have one location on our network full of .zip files. They are all named like "12-3456.zip" etc. I need to move each of these .zip ...

1 2 3
4
5
8