Questions tagged [applescript]

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

650 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
1 answer
1k 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 ...
hpl002's user avatar
  • 181
7 votes
0 answers
521 views

Applescript - Reminders - Unbearably Slow

I wanted to write a script to "push" reminders back by an hour. I came up with this: tell application "Reminders" launch set c to current date set newtime to c + 3600 set the remind ...
Markus's user avatar
  • 71
7 votes
1 answer
4k views

AppleScript to read all notifications in the Notification Center OSX 10.10 Yosemite

It seems like the following AppleScript is no longer working in the latest version of the OS X 10.10 (Yosemite): on run tell application "System Events" tell process "...
Fabio Moggi's user avatar
6 votes
0 answers
886 views

Yosemite Mail "Load Remote Content" from senders in my contacts

I would like Mail on Yosemite to load remote content from senders in my contacts and not for everyone else. I have remote content disabled now and I have pieced together an AppleScript to click the ...
alecho's user avatar
  • 160
5 votes
0 answers
14k views

Convert Mac to Windows paths and visa-versa for sharing with colleagues

Wanted to share perhaps a more thorough answer to this question, where the solution does not satisfy. Reference: How to translate between Windows and Mac -style file locations? PROBLEM From a Mac, I ...
Matt Deniston's user avatar
5 votes
1 answer
434 views

Any way to write the Terminal scrollback history?

I would like to open a new tab in Terminal with custom scrollback history. The primary use-case is to "fork" an existing tab such that both tabs contain the same scrollback history, but more generally ...
TerminalUser's user avatar
4 votes
1 answer
820 views

Cannot send image files from Messages using AppleScript on Monterey

After upgrading to Monterey, I can't send image files through Messages using AppleScript. The script below worked before I upgraded to Monterey. I think it's some sort of privileges/sandbox bug and ...
Gintaras's user avatar
  • 479
4 votes
1 answer
1k 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: ...
undefinedChar's user avatar
4 votes
0 answers
733 views

How to use AppleScript to make Siri shortcuts?

Is there a way for me to configure my MacBook with AppleScript so that Siri will tell me my schedule for the day and other relevant information I want to know? I would like to be able to write ...
Jack Moody's user avatar
4 votes
0 answers
2k views

Click a button on dialog window using AppleScript on Microsoft Excel

When I open the .ods file in microsoft excel I would like to on the "Alert" dialog box click "Yes" with the apple script. I try like this, but not work :( set theWorkbookFile to choose file with ...
Grzegorz's user avatar
4 votes
0 answers
10k views

How to get rid of the "Grant File Access" dialog in Word 2016+AppleScript when inserting a picture

We use AppleScript to create MS Word documents, which also included pictures. This works fine with Word 2011, but I run into problems with Word 2016. When opening files with Word 2016 via ...
doekman's user avatar
  • 707
4 votes
0 answers
600 views

Executing "Copy Dropbox Link" with a script

I want to create a script that executes the command from the contextual (control-click) menu, "Copy Dropbox Link". How can I access this command with Applescript (or any other Mac scripting service)? ...
Crowder's user avatar
  • 3,924
3 votes
1 answer
106 views

How to send an email with AppleScript, without the text being put in a blockquote

I am trying to use AppleScript to automate sending mails through AppleMail, but the message always ends up being send as a blockquote (i.e. as if I replied to an email and my message got quoted). Is ...
powerpete's user avatar
3 votes
0 answers
143 views

Automating Zoom.us app with applescript

I'm helping disabled person to adapt Zoom application for their special needs. The problem is that zoom exposes only raise hand reaction via Option + y keyboard shortcut. My goal is to let this person ...
A B's user avatar
  • 480
3 votes
0 answers
89 views

Is it possible to add url to reminder through AppleScript in attachment (preview) style

Hi folks, I have an apple script question. Maybe someone know is it possible to add reminder with url in form of preview and not text (on screenshot I want a bottom variant) Adding url in form of the ...
japanese-goblinn's user avatar
3 votes
0 answers
1k views

Not authorized to send Apple events to System Events. (-1743)

I can execute my Apple Script when I load/open it from Apple Script Editor. No errors. However, I have added Editor to the menu bar of my Mac (Catalina OS) with my script copied to the User Scripts ...
wuki's user avatar
  • 31
3 votes
0 answers
466 views

How to stop Mac apps from automatically recognising phone numbers?

Whenever there's a string of a few numbers on my Mac, it recognises it as a phone number and tries to dial it (through FaceTime) every time I click it. Is there a way to stop this, either with System ...
Righter's user avatar
  • 154
3 votes
0 answers
100 views

Any tricks anyone can recommend on how to uniquely identify a window (in any app) after restart?

I have a fun little project I am working on. I am developing an AppleScript that saves and restores windows to their original desktops (a.k.a. "Spaces") after a restart or an app relaunch. ...
hepcat72's user avatar
  • 1,257
3 votes
1 answer
1k views

Use Google speech to text instead of Apple's

Google currently has much higher quality speech transcription. You can try it easily by going to doc.new and pressing Cmd-Shift-S and talking. Compare to using the built in system from Apple (pressing ...
avv's user avatar
  • 273
3 votes
0 answers
350 views

Using AppleScript to delete an event still existing in Calendar?

I'm trying to write an AppleScript that clears a calendar (an iCloud one) of all of its events. I have the following: tell application "Calendar" tell calendar "Test calendar" set ...
Patrick's user avatar
  • 31
3 votes
0 answers
184 views

Programmatic (AppleScript) access to notification centre history

I have followed this thread, which addresses active notifications which appear on the desktop: How do I clear All OS X notifications with 1 click?. These solutions offer programatic approaches to ...
Barton Friedland's user avatar
3 votes
0 answers
164 views

highlighting text in safari

I need to highlight every instance of some keywords in Safari. I have this script which work : set myList to {"demo", "demo1"} try tell application "Safari" do JavaScript "document....
Kevin's user avatar
  • 2,338
3 votes
0 answers
1k views

loginwindow high CPU usage

I have simple zsh script which executes the following code at a regular interval. spotify_track=`osascript -e 'tell application "Spotify" to name of current track as string'`; This is causes ...
mohitmun's user avatar
  • 131
3 votes
0 answers
1k 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" ...
laetitia's user avatar
3 votes
0 answers
1k views

AppleScript and Numbers: Copying from one spreadsheet to another?

I'm new to AppleScript, and I'm trying to find a way to use it to copy a value from one Numbers spreadsheet and paste it into another file. The situation is that I've been using Numbers to run a ...
Paul C's user avatar
  • 31
3 votes
0 answers
205 views

Close Dock and top bar

Is there a way to keep the application Dock closed. Every time I do: killall dock It closes for a bit then automatically reopens. I want to be able to make an AppleScript program that keeps it ...
Bradman175's user avatar
3 votes
0 answers
233 views

Is there a tool or scripting approach to change the arrangement of displays?

I move my monitors around a bit during the day. Specifically I rotate them or move my laptop to different positions. Each time I have to open up System Preferences > Displays > Arrangement and make ...
studgeek's user avatar
  • 4,221
3 votes
0 answers
324 views

Export image from clipboard to folder

I create a lot of mockups for my mobile phone. I recently heard of the brilliant idea to just put your current mockup as an image into your Dropbox (or whatever cloud your using). Then just take your ...
fancy's user avatar
  • 361
3 votes
0 answers
2k views

Set iMessage sender in applescript for a new message

Applescript allows you to send messages via iMessage and the command line, ie) https://stackoverflow.com/questions/11812184/how-to-send-an-imessage-text-with-applescript-only-in-provided-service Is ...
Luke Rehmann's user avatar
3 votes
0 answers
579 views

Detecting typing in Messeges app using applescript?

In the new Messages app, which replaced iChat, you can see when another person is typing: And i've been scripting around the messages app and was wondering if there was any way to detect when the ...
Trevor Rudolph's user avatar
3 votes
0 answers
380 views

Applescript vs. Spaces in Lion (10.7)

In Snow Leopard (10.6), I had an applescript that toggled iTunes between "maximised on Space 2" and "mini-player on all spaces": set app_identifier to do shell script "echo 'com.apple.iTunes' | /usr/...
Ben Williams's user avatar
3 votes
1 answer
338 views

Is there a way for AppleScript to detect when a Desktop is switched?

When I switch desktops, I want to have a way to remind me of the purpose of that desktop. I'm thinking of using AppleScript to detect when I switch desktops, and show a pop up of sorts. Desktops / ...
makerofthings7's user avatar
3 votes
1 answer
3k views

How can I permanently force Xerox secure printing?

My clients are printing direct to a network printer (no print server). Xerox have confirmed that the Secure Print Only option is only available in Windows, so I am looking at editing .plists, ...
Si King's user avatar
  • 135
2 votes
0 answers
34 views

Disable Badges with a script on multiple apps in Ventura

Trying to have a script I can use with a shortcut to disable badge notifications on multiple apps for when I need to focus - like for example in a meeting, etc. I don't want to have to go into ...
Ery's user avatar
  • 21
2 votes
0 answers
126 views

Ventura, automatically close all "Disk Not Ejected Property" notifications?

On macOS 12.x I was using a script to automatically close massive number of Disk Not Ejected Properly notifications that show up the next morning if I inadvertently leave my computer running with one ...
inspirednz's user avatar
2 votes
1 answer
112 views

Mac Mail - Set signature by sending address

I use macOS's Mail app and have iCloud+. I have two mail addresses - my usual iCloud address and another through a custom domain that I own, that maps back to the iCloud account (something which is ...
Albert's user avatar
  • 121
2 votes
0 answers
51 views

AppleScript's "Set first paragraph to" using Mail no longer works with 13.1 (Ventura)

I have an Automator/AppleScript task working since months that takes a selected e-mail, replies to it and adds a standard greeting on top of the reply. Since updating to macOS Ventura (13.1), the ...
fredlcore's user avatar
2 votes
0 answers
114 views

Help with writing an AppleScript to navigate to profiles and double click the first profile

I'm new to AppleScript and I'm trying to write one that opens System Settings in macOS Ventura, navigate to the Profiles pane (or at least it used to be called that) and double click the first profile ...
Jonny's user avatar
  • 63
2 votes
0 answers
46 views

Setting bounds of Chrome windows with AppleScript

I frequently switch between setups with my external monitor on different sides, so I'm trying to create a script that sets the bounds for my standard 6 Chrome windows. I think I've figured out the ...
wassilywabbit's user avatar
2 votes
0 answers
444 views

How to run VBA macro using AppleScript?

To run VBA macros stored in Personal.xlsb, I have to: Tool - macros (I use menu bar search for this) In the macro dialog box, I have to go to the end of xlsb! and type the name of subroutine (have to ...
PSZ's user avatar
  • 31
2 votes
1 answer
200 views

Applescript permissions in Mac OS 12

My music licensing business uses Filemaker and quite a few Applescripts as part of its day to day operations. For years we have been running everything on OS 10.14 without any issues. We recently ...
user1588920's user avatar
2 votes
0 answers
103 views

Extract URL from incoming Mail and open in background

I'm regularly receiving the following message: Dear User, SSH access to the cluster has been requested from 111111.public.t-mobile.de (IP 000.000.00.000). If this was you, please activate the SSH ...
Saraha's user avatar
  • 21
2 votes
1 answer
264 views

How do I get the "percentage completed" to work on Automator apps?

When I create apps with Automator, they run with the little cog that appears in the top right. When I click the cog it says "0% completed (Run Shell Script)". This feature is documented ...
Alfie Stoppani's user avatar
2 votes
1 answer
294 views

Applescript search and delete specific Mac Text Messages

Hackers have daily targeted my Mac Messages app. I get a dozen or so messages daily from similar but slightly differing handles. For example: All of the handles using an email address has ...
Bruce Christy's user avatar
2 votes
0 answers
242 views

Add Reminder with container reminder with applescript

I have this script to get all current window of chrome tab urls and add them as reminders: set titleString to "" tell application "Google Chrome" set tab_list to ...
mondi's user avatar
  • 163
2 votes
0 answers
51 views

Alert me if my mic input reaches a certain level

My housemate complains that I speak too loud (when having phone calls or during Zoom meetings). After failing to consciously control my voice level many times, I decided to ask for help by making this ...
Sam Tan's user avatar
  • 21
2 votes
1 answer
311 views

Open the most recently closed Finder location (tab or window) with a keyboard shortcut

In Finder, I can reopen a tab or window I just accidentally closed by going into the Go > Recent Folders menu and pick one of the recent folders from the list. I'd like to open it with shortcut ⌘ ⇧...
monotom's user avatar
  • 61
2 votes
0 answers
39 views

Solid fill background which is based on the time of the day

Live wallpapers have been available on Macs for a while, and I was wondering if there is a way to set up the wallpaper to be one of the solid fill colors available in the System preferences dialog, ...
gen's user avatar
  • 241
2 votes
2 answers
2k views

AppleScript - Click coordinates stopped working

I use a web-based program that lacks batch actions. This creates the need for repetitive clicking. I wrote a script on Apple's Script Editor that took care of that, it is very simple and worked ...
GabePhil's user avatar
2 votes
0 answers
87 views

What does Command + ("Bigger") actually alter in OS X Terminal?

At first glance issuing Command+ (View -> Bigger) in OS X Terminal simply increases the font size, and increases the window size while keeping the number of rows/columns the same. However, I can't ...
ben's user avatar
  • 71

1
2 3 4 5
13