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
1answer
44 views

Paste preset html code via Applescript into text edit

Hi so I want to preset specific line of html code, and then paste it with key combo using Applescript. Here is the html code: <li> <div class="topic-title"> <h2>Topic title goes ...
1
vote
0answers
32 views

How to open a window and tab in Terminal via Javascript automation

I want to use the Script Editor program to create a script (Javascript) that will recreate my Terminal window and tab setup. I open a few windows, open tabs within those windows, label the tabs, run ...
0
votes
0answers
11 views

Get artwork of song Apple Music

I can't seem to be able to get the artwork data of my currently playing songs... tell application "Music" if running then set songArt to data in artwork end if end tell This should ...
0
votes
1answer
346 views

Automator: remove last 9 characters in filename

I'm hoping to find a solution that will be a simple fix. Here's what I want to do: Every week I have a new batch of files that I process through Apple's Automator to complete various functions such as ...
1
vote
1answer
64 views

AppleScript to massage URLs

I want to have a Services menu item that takes the selected text (a URL) and escapes the percent character and the # character: Replace % with \% Replace # with \string# I copied and edited an ...
1
vote
1answer
46 views

How can I initiate scripts to run on my Mac from triggering events on my phone?

I would like to replace the mechanism I currently use to trigger scripts to run on my Mac. Currently, I use mostly IFTTT applets that create text files in Dropbox. Then I attach folder actions to ...
0
votes
2answers
60 views

Repeat AppleScript if User Confirms a Pop-Up Dialog

I built a script that selects and copies all text from the front Safari tab, closes the tab, and pastes the text into the front BBEdit document with a couple blank lines of padding. I'll run it when ...
-1
votes
1answer
52 views

Creating a New TXT Document within a Newly-Created Folder

I'm building an Applescript that currently creates a new finder folder inside a certain folder: tell application "Finder" activate make new folder at folder "RecUp Memos" of folder "Dropbox" of ...
0
votes
1answer
36 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
181 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
30 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
38 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
60 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
46 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
74 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
57 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
63 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
42 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
104 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
73 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
28 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
43 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
136 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
34 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
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, ...
0
votes
0answers
76 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
380 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
56 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
61 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
140 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
76 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
47 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
27 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
97 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
75 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
289 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
114 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
68 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
179 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
53 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 ...
1
vote
2answers
51 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
95 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
96 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
58 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
77 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
121 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
95 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
43 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
64 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
259 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 2 3
4
5
54