Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Creating a New BBEdit Document within a Newly-Created Folder

I'm building an Applescript that currently creates a new finder folder inside a certain folder. Next step is to create, name, and save a new (blank) BBedit document inside that new folder. Can ...
0
votes
1answer
24 views

How to close specific URLs with Applescript

I'm trying to write a little applescript that closes tabs that have URLs that do not contain certain text, but I can't get it to work. Right now, my script closes every tab regardless of the URL. ...
0
votes
1answer
39 views

In Automator, can I combine 2 or more variables into a new variable?

First off, let´s set the scene. I am trying to make a small applet (.app) to include in a DMG-file for distribution. The .app file will only activate when a user drags a folder with my product-files ...
1
vote
0answers
25 views

Include a binary in applescript bundle?

I've got an applescript that calls a binary on my computer (installed with homebrew). I'd like to share the applescript with friends, but can't guarantee that they'll have the binary. For example, a ...
0
votes
0answers
25 views

Is it possible to AirPlay my Mac's desktop to an Apple TV via the command line?

I'm ultimately trying to automate a process which AirPlay's a Safari browser to an Apple TV. I'm familiar with the say -a "AirPlay" command which only AirPlay's audio so I was hopeful that there could ...
1
vote
1answer
51 views

How to reproduce Windows Chrome BAT files setup in macOS 10.15

On Windows, Chrome is my primary browser. I've developed a series of *.bat files on Windows that each open a series of tabs with specific URLs in Chrome: @echo off set BROWSER=chrome.exe set ...
1
vote
1answer
21 views

How can I create a shortcut to open Safari PDF in Preview?

If I open a PDF file in Safari (say, from a website), it is shown in a browser window or tab, and from there I can hover over the bottom of the page and from there click on this overlay to open the ...
0
votes
1answer
50 views

AppleScript tell Numbers make Pop-Up Menu from Contacts Group names, wait for input, then Email ScreenCapture

This is a bit long-winded, but here goes… Using AppleScript (vanilla, please), I want to automate the Numbers spreadsheet I made for my wife’s music lessons Accounts (which she uses four times a ...
0
votes
0answers
33 views

AppleScript - Repeat While with Return

My goal is to run a script continuously for 10 seconds, returning the result while the script runs. Right now when I run the script below the script stops after returning the result. If I remove the ...
1
vote
0answers
56 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 ...
0
votes
0answers
40 views

Applescript (Adobe Illustrator) find coincident X coordinate on a path for any given Y coordinate

I have two lines as shown in the screenshot below (Adobe Illustrator file) which my script produces. Is there any way, using AppleScript, to find the value of X for the coincident points on the ...
0
votes
2answers
87 views

Problem with Automator/AppleScript Question

I am building a program to delete files/folders. Here is how my program looks in Automator: The problem I am having is sometimes where the program runs I get this error: The program does work so I ...
0
votes
0answers
40 views

Running “do script” synchronously in AppleScript

I have the following AppleScript that I run on login: on run {input, parameters} tell application "Terminal" do script ".../MyScript.sh" end tell return input end run I run ...
1
vote
0answers
26 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 ...
0
votes
0answers
39 views

How do I continuously check the status of a process and execute something once the process stops with an Apple Script?

I'm using an Apple Script to open an application and transcode a file. What I need to be able to do is continuously check the CPU usage of the process and when the CPU usage hits 0 I need to do ...
0
votes
1answer
91 views

How To Remove Only The Characters Inside Brackets [ ] From A String

So I have been searching for hours on how to do this via Applescript and I see no post about it. Basically, I have the following string: @junior_cat23, [ID]-[E9B-Z8X-H1V-722] I want the script to ...
0
votes
0answers
24 views

Convert resource-fork type 1 font files to some sort of data-fork font files?

I am trying to sort and organize resource-fork font files, and I'm trying to figure out if there is a tool that can do it for me, or some pointers to some documentation that would help me write my own ...
1
vote
0answers
47 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, ...
0
votes
0answers
28 views

Applescript to send email messages to the ALL EMAILS of persons with specific in interest

I am trying to write a script that filters the persons in the Contacts application whose note include a specific keyword and sending those who has at least one e-mail address an e-mail (to all their ...
1
vote
1answer
119 views

Catalina Messages app: run applescript on receive new message & when the message is read?

Are applescripts for Messages still saved in /Library/Application Scripts/com.apple.iChat? That seems like an odd location, but I didn't find a folder for com.apple.messages I tried saving this in ...
0
votes
1answer
47 views

Applescript to send email messages to the persons with specific in interest and with at least one email address

I am trying to write a script that filters the persons in the Contacts application whose note include a specific keyword and sending those who has at least one e-mail address an e-mail. I have written ...
0
votes
0answers
23 views

Repeat keystroke while key is held [duplicate]

Is there a way or a 3rd party application which would let me 'send' a keyboard input/keystroke to a game (so that it has the same effect as physically hitting the key on the keyboard rather than just ...
0
votes
1answer
52 views

AppleScript click Ui Element with modifier keys

I want to click an Ui Element button with modifier keys pressed. Here is my code: tell application "System Events" tell process "Pro Tools" tell (1st window whose title contains "Edit: ")...
1
vote
0answers
36 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. ...
0
votes
0answers
25 views

Mail Script in Rules

Hopefully, I can explain what I am attempting to achieve. I have an email address designated for SMS (sms@domain.com) This account gets check via Mail (apple V13). I have a rule that every message ...
0
votes
0answers
16 views

Is Paste Special via AppleScript broken in Microsoft Excel?

This seems like a fairly straightforward question. I am using Microsoft Excel 16.10 on a Mac running 10.13.6. When I run the following code: tell application "Microsoft Excel" tell worksheet "...
0
votes
1answer
87 views

How can I automate adding sender addresses to a Rule in macOS Mail? [duplicate]

So I've created a Mail Rule "Bin Spam Messages" that will delete messages from a sender. What I can't figure out is how to automate adding new sender addresses to the rule. I'm guessing I could do ...
1
vote
1answer
59 views

Batch Removal of “Where from” Metadata Without a Handler

I have many images that contain the "Where from" metadata in the "get info" section that shows the URL where they were downloaded from. I want to remove this information from all of them at the same ...
0
votes
2answers
100 views

How to mount a disk image with automator or Applescript and without hdiutil?

An Automator workflow that mounts a disk image on when I drag and drop the dmg file onto it is easy: Instead of dragging and dropping the dmg file I want to double click the created workflow and ...
1
vote
1answer
54 views

How can I tell if True Tone is on/off in a script?

I want to be able to print out if True Tone is on or off in a script. Is there a command to determine this?
0
votes
0answers
63 views

How to open multiple folders with a specific Application (Gemini 2)?

This is a supposed to be a simple AppleScript but I have searched many post on stackexchange.com and I cannot find anything that works. Basically, "Gemini 2" is a duplicate of finder (macpaw.com/...
-1
votes
1answer
41 views

QuicKeys no longer runs in Catalina, how to run AppleScript on schedule?

don't use Calendar instead, it always fails. QuicKeys is always promising although it can't wake up the Mac itself.
0
votes
2answers
44 views

Can't Rename Images Sequentially Via Applescript Because Other Images Already Have That Name

I am trying to automate batch renaming of images sequentially by using a simple Applescript. But I am having difficulty telling the script that there are images in the same folder that already have ...
0
votes
2answers
33 views

applescript: determine the date of last Sunday

I need to take today's date and work backwards to Sunday and get that date. so, for instance today is Monday, December 16. I need to know that the previous Sunday was December 15. I've tried ...
1
vote
0answers
30 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"...
0
votes
1answer
89 views

Having Issues Renaming Files That Are Moved From A New to Old Folder via Applescript [duplicate]

Ok so this is a complex script that I hope someone out-there can help me with because I have spent the entire day trying to figure this out. Lets say I collect cat images from Instagram and I have ...
0
votes
1answer
40 views

How to make and alias list from multiples results of a shell script?

So this is the shell script that I have in my Applescript editor which brings up all of the videos that have been added to my computer today. do shell script "mdfind 'kMDItemDateAdded >= $time....
0
votes
2answers
70 views

Automator Change to directory of dropped files before running Shell command

Seems extremely simple, but I can't figure it out... I want to be able to change to the directory (folder) where the dropped file is located before running my shell script on that file. So either I ...
2
votes
0answers
59 views

Open Safari Passwords pane with AppleScript or Shell script

I'm trying to find a way to open the Safari Passwords pane without opening Safari - similar to how Siri opens it when you ask "Show me my passwords" on macOS. Any ideas? I'm thinking some kind of URL ...
0
votes
0answers
33 views

Apple Script - append text to note with new line

I am having a little trouble appending Text to a Apple Note. set AppendedText to (the clipboard) ################################### tell application "Notes" tell account "iCloud" tell ...
0
votes
1answer
40 views

Tools, languages, libraries and API's for development of a MacOS wide application [closed]

Please just assume that the user has accepted whatever permission are required. Is it possible to listen to window actions under MacOS? In Swift preferably? For instance, if a window moves, is ...
0
votes
0answers
29 views

Automator - applescript - (condition) if X button exist then click, if not, click Y button

I am struggling with writing a script for opening up a webpage and click different buttons depending if the button itself exists. I want it to be if X button exists, then click X button. If Y button ...
1
vote
0answers
35 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?
0
votes
0answers
22 views

Apple Script - How to I check if an iCloud Drive file has been updated from another device?

Is there a way to check, via applescript, which device has updated a file stored in iCloud Drive? I know that the terminal command mdls [file path] lists lots of metadata. Does any of it identify ...
0
votes
0answers
49 views

Automator script to convert webp file to JPG not working

Hi I'm trying to write a Catalina mac Automator script that will convert .WEBP files into .JPG files. The shell code in Automator I'm using is for img in "$@"; do filename=${img%.*} /usr/local/bin/...
1
vote
0answers
26 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, ...
2
votes
1answer
43 views

AppleScript to choose item on web page

Is it possible with AppleScript to choose a clickable element in a web page and click it and if so, can you give me an example?
1
vote
1answer
20 views

My mac Automator Application script is not working with two arguments

On my Catalina mac, I have this Mac Automator shell script to remove all metadata from image files as follows: for f in "$@" do /usr/local/bin/exiftool -all= "$f" done Now this utility exiftool by ...
0
votes
0answers
19 views

Incorrect validation loop [duplicate]

I made a loop that inserts a number into a string, and by the color of the number (blue - registered, red - missing), using the standard utility Digital Colors Meter determines the color of the number....
1
vote
1answer
24 views

Apple Script - How do I check if the bounds of a window are equal to specific values?

I know that the following code can adjust the bounds of a specific window set bounds of (front window of application "Notes") to {0, 0, 540, 300} But how do I check if the bounds of a window are ...