Questions tagged [applescript]

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

285 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
111 views

Change keyboard layout automatically when external keyboard connected

I recently purchased an external keyboard (non-apple) that is used at home and also dragged along with me from time to time, and I've noticed a need. My Mac is in English, as well as its physical ...
1
vote
0answers
66 views

AppleScript grab value from safari with repeat / add in list

I need to grab data from a safari, There is a random number of : document.getElementsByClassName('sortable DataSummary')[1] this work fine : tell application "Safari" set mzRawData to do ...
1
vote
0answers
171 views

Using Applescript to get the subject of an email - Not working as advertised

I'm new to Applescript, trying to do a basic script that gets called from a mail Rule. Im stuck on getting the subject. There doesnt seem to be one available. using terms from application "Mail" on ...
1
vote
0answers
46 views

Applescript Access to Outlook New Mail menu bar

I'd like to workaround a limitation with Outlook which is of it not allowing me to set a delay all emails sent by x minutes. A way I thought about working around this is to use Alfred Worklfows Hotkey ...
1
vote
0answers
45 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
73 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
58 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
309 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
41 views

How do I find the actual command that was used to run an AppleScript script?

From https://stackoverflow.com/questions/5770384/how-find-the-file-name-of-an-executing-applescript I know that you can use the path to me as text in order to get the absolute path name of the ...
1
vote
0answers
66 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
61 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
46 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
400 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
86 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
103 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
150 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
78 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
95 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
61 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
268 views

Is there any alternative to the now-missing “AppleScript handler” option in Messages that allows playing custom sounds depending on sender?

In the Messages app, starting with the MacOS 10.13.4 upgrade Apple has removed the "AppleScript handler" option, which I had formerly used to play custom notification sounds when new messages were ...
1
vote
0answers
316 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
388 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
37 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
288 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
50 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
117 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
159 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
222 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
325 views

Display long text with applescript, preferably with a scrollbar

How can applescript display a long text that does not fit on the screen? I am looking for command similar to "display dialog", yet where I would be able to read the whole text. "display dialog" ...
1
vote
0answers
138 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
224 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
174 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
356 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
58 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
58 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
198 views

Can an AppleScript create new variables on its own?

I have an AppleScript .app file that creates a list variable based on a website's HTML data. The number of items in this list varies based on the unique HTML data that is downloaded on every iteration,...
1
vote
0answers
82 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
241 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
98 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
128 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
74 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
65 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
39 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
344 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
312 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
269 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
156 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
164 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
580 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
269 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"&...