Questions tagged [applescript]

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

332 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
58 views

ApplesScript, autopress space bar

I am trying to run a script that will double press space bar in a fast sequence after this command repeat 10000 times tell application "System Events" to keystroke "g" using command down ...
1
vote
0answers
27 views

How to plot a point on the circumference of a circle using AppleScript and Illustrator

I need to put a grid of squares inside a circle in Illustrator. Ive written a script that works for this and gives me the following result But the problem I have is that the small areas of the grid ...
1
vote
0answers
50 views

Can the Books app be automated or scripted?

I don't know much about AppleScript or Automator. I use Catalina, up to date as of today, 2020 Jan 06. Today I was trying to use Automator to change the Category of multiple books in my Books Library, ...
1
vote
0answers
58 views

applescript how to focus keyboard on menu bar 2

I am trying to get the keyboard to focus the right menu bar (Bartender 3 has this exact same feature). In System Preference, Shortcut, Keyboard there is a shortcut but it works only for the left menu. ...
1
vote
0answers
56 views

enabling javascript in Chrome using an AppleScript

Is it possible to enable Javascript in Chrome aside from manually scrolling through the View menu? I tried scripting it, but it didn't execute or list any errors: activate application "Google Chrome"...
1
vote
0answers
71 views

iCloud Drive - Is there a way to manually refresh iCloud Drive files?

There's nothing wrong with how my iCloud drive files sync. It's just that sometimes it takes several minutes for them to sync. Is there a way to manually trigger a refresh?
1
vote
0answers
27 views

How to I create a Dock menu for my AppleScript application?

I just created an application with AppleScript, and I would like to create custom menu items for its Dock menu, as shown in the image below. How do I do that? I'm somewhat familiar with AppleScript, ...
1
vote
0answers
16 views

Can I detect if trackpad is touched by applescript?

For exemple I want to type capital letters when my thumb is on Trackpad, and type lowercase letters when Trackpad is untouched
1
vote
0answers
90 views

Adding login items from terminal in Catalina

I've tried multiple ways but none work. A few AppleScripts and even some bash script somebody made. Which essentially just executes a different AppleScript afaik. Some of the commands I have tried: ...
1
vote
0answers
13 views

How to scan for visible Airdrop devices via Applecript?

I'm trying to figure out a way to scan for nearby airdrop devices and display a list of them but I've had trouble finding relevant examples or documentation. Can anyone point me in the right direction?...
1
vote
0answers
35 views

Applescript: forward Outlook email as attachment

I have an AppleScript service that helps me automate reporting spam/phishing email to our IT group. I noticed that it forwards by embedding the content directly in the forwarded message, which ...
1
vote
0answers
30 views

AppleScript : Repeat until document.getElementsByClassName is true

I'm trying to wait for a element to be available on Safari before the script can continue repeat set JSChecker to "Not Found Yet" try tell application "Safari Technology Preview" ...
1
vote
0answers
233 views

How to get macOS Catalina Reminders to work with Apple Script?

I'm trying to create a Workflow that adds a specific task with 3 subtasks to a specific list in the new Reminders (that was released with Catalina). How can I access a list that is in a group? For ...
1
vote
0answers
29 views

Folder Action Script: Alert when a file is being moved or deleted in a folder and its subfolders

I manage my accounting via the finder in OSX. I scan all documents and put them into separate folders, each year get's a new folder. Much like I would do this in real life. It's all good, but ...
1
vote
0answers
16 views

Tab Stack like unsupported burkeware

I was wondering if there is a script I can add to Safari 13.0.1 to make the active tab move to the left. The description of what I am trying to do is here; https://blog.burkeware.com/2015/12/01/tab-...
1
vote
0answers
27 views

How to open excel files attached to emails using AppleScript?

My goal is to write a script that opens an attachment in excel when activated by a mail rule. It does not need any loops to go through multiple emails or attachments, just run once per email and then ...
1
vote
0answers
79 views

How to simulate keystroke in a GUI application programmatically?

On Windows I use AutoHotKey, I can create a GUI window that can be "Always On Top", I can create different Tabs that contain buttons with names that will send keystrokes/macros to a particular ...
1
vote
0answers
34 views

AppleScript to fast forward YouTube videos

I'm trying to use AppleScript to fast forward YouTube videos by 10 seconds in Chrome, but the following code doesn't work; I get missing value as output, instead. What I am doing wrong? tell ...
1
vote
0answers
26 views

AppleScript and Mail: Weird selection behaviour?

I) Intro In AppleScript, when - for example - I do tell application "Mail" set mselection to selection as list tell application "System Events" tell application "Mail" ...
1
vote
0answers
189 views

AppleScript and Mail: Read out Mailbox of Message and select first read message in Inbox

I) Intro I'd like to read out the mailbox a message (of Apple Mail) is currently in. To read out a message's id one can use: tell application "Mail" set m1 to message 1 of inbox return id ...
1
vote
0answers
151 views

Applescript to set environment variable before opening terminal

I have the following Applescript in a workflow assigned to a service hotkey that opens a terminal in a given Finder window: tell application "Finder" set myWin to window 1 set thePath to (...
1
vote
0answers
77 views

Apple Script with Terminal Commands

I'm trying to create an application that would automate a couple of Terminal commands. I need the application to open once I drop a file on top of it, run the commands, and close. The sequence of ...
1
vote
0answers
115 views

Applescript to set terminal window to specific size

I found this question Is it possible to define the width/height of a Terminal window with this command: osascript -e \'tell application "Terminal" to do script and tried setting my ...
1
vote
0answers
88 views

How to make AppleScript ignore escape characters in string to make a Note

I have a python script that takes a user's input and inserts it into the name and body parameter of the make new note apple script. The problem is that any escape or special characters get interpreted ...
1
vote
0answers
39 views

How to execute a PKG file using a custom universal keyboard shortcut?

It may sound strange but I need to run a specific PKG installer whenever I trigger a specific custom keyboard shortcut. On Sierra 12.6 I've assigned a custom keyboard shortcut to sleep/lock-screen the ...
1
vote
0answers
43 views

Replace font in incoming mail [mail.app]

I'm trying to write an Applescript (my first) to change the font of incoming emails using a rule in Mail.App. In particular, some tasteless individuals use Comic Sans, and I want to change their ...
1
vote
0answers
47 views

Help with Apple Script for dealing with duplicates in Numbers

I had a script that I used to find duplicates in a numbers document and to highlight the duplicate in red. Well I now have a file where there are multiples of the descriptor in column B that are ...
1
vote
0answers
58 views

AppleScript : to do Javascript action in Safari repeatedly

I created this script to highlight some data points in Safari. This was working fine but I had to restart the script often as shorting the data in a different order remove all the highlight ... I ...
1
vote
0answers
71 views

Place html data on the macOS clipboard via applescript

I want to use applescript to place HTML data onto the clipboard from a text variable. I have at present a line of code that invokes applescript via the command line from my applescript. set toUnixSet ...
1
vote
0answers
26 views

AppleScript : two class with same name

I'm getting some text from Safari in a column. I used to use this script to add all text from this column in a list : PS the class is class="sortable null" tell application "Safari Technology ...
1
vote
0answers
81 views

applescript- script works when used in Script Editor but does nothing when saved as standalone app

Don't judge, my first code lol. How do I fix the stated issue and suggestions for improvement would be great. I just tried making something to pause music when I started a video and start playing ...
1
vote
0answers
26 views

Strange AppleScript behaviour in relation to Reminders

I am trying to write a small script that will move all reminders from one list to another. After some experimentation, I have come up with this, that seems to do what I want: tell application "...
1
vote
0answers
43 views

Can AppleScript select text after my cursor between designated characters?

I would like an AppleScript to start from my current cursor location (or the end of the current selection if there is one), scan forward to the next ";" or "(", then select all text until before the ...
1
vote
0answers
375 views

Running a command with access to “System Events.app” granted

I am updating applications installed via Homebrew from command line. iTerm2 requires access to "System Events.app" to be correctly updated, which ends up in a process that is not fully automated and ...
1
vote
0answers
44 views

AppleScript : cleaning text

Is there a way to remove some occurrence of a variable within a text without knowing where the variable is in the text ? e.g : IP= DA, null, var to be removed from the text : ", null," I ...
1
vote
0answers
203 views

PowerPoint's save as PDF in AppleScript results in print job

I have a small AppleScript to save a PowerPoint pptx file as PDF from command line. I use the script every 6 months, and last autumn it still worked. But today I run into problems. I updated to 10.14 ...
1
vote
0answers
61 views

How to automatically attach folder actions to all added subfolders recursively?

TL;DR How do you make a folder action that attaches folder actions to added subfolders? Is that even possible? My end goal is to convert gps/location-based reminders of specific locations (e.g. home/...
1
vote
0answers
92 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
206 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
65 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
106 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
68 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
375 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
103 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
104 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
50 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
558 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
119 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
128 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
168 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 2
3
4 5
7