Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [applescript]

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

3
votes
1answer
26 views

Applescript: Help with idle and hiding from finder?

I'm trying to get my script that works to do 2 things: run in the background every 60 seconds, and disappear from the finder and the dock. Original: tell application "System Events" set ...
1
vote
1answer
22 views

In AppleScript, how to open a URL location that contains a hash (#)?

I have a workflow written in Alfred that when opening a URL location in AppleScript, the URL will be urlencoded() which effectively breaks: open location "https://example.com/#hello" & ...
3
votes
1answer
27 views

Applescript: save all open tabs in Chrome to PDF

I would like to make an AppleScript that saves all of the open tabs in the front window in Google Chrome to a PDF. Here is my working MWE so far: tell application "Google Chrome" set allTabs to ...
-1
votes
1answer
32 views

AppleScript click on Safari <th> link

Based on this HTML tag, how can I click on View from TrustedMachines? I know how to do it from document.getElementById or name but not sure how to do it this cases <td> <a data-auto-...
1
vote
1answer
31 views

AppleScript to rename Safari Tab

There is an option in Keyboard Maestro to rename any tab on safari with the name you want I'm trying to do the same using AppleScript but is this even possible? I have nothing so far, I'm guessing ...
1
vote
1answer
60 views

Applescript to set non focus tab in safari

I made a script to find an tab based on it's URL and set a new URL (the tab is not focused) tell application "Safari" set topWindows to every window whose name is not "" set numWindows to the ...
0
votes
1answer
23 views

applescript : add clipboard content to list

Can I create a list from the clipboard? Let's say my clipboard is `name email phone and any random number of text Can the words be separated and added in a list? Also the item can be either text ...
0
votes
0answers
25 views

Automatically export new emails to folder?

The manual process: New email arrives in inbox X (Apple Mail) Drag-n-drop to Finder folder Y Delete email in inbox X How can this be done automatically using AppleScript/Automator?
2
votes
1answer
67 views

What is the difference between HFS path and alias path?

This was brought up in a comment from another question/answer and I was curious what is the difference between an HFS path and an alias path. My understanding they were the same.
2
votes
2answers
28 views

osascript -e command for displaying a text in status bar?

Doc has reference to how to display a notification alert but not sure if there is an option to display a message in status bar that can be updated like a price ticker.
0
votes
2answers
62 views

AppleScript shell script

How can I run a shell script on multiple different computers with the same code? If I have it run from /users/'my name'/desktop/etc. then it won't work when I use it on a different computer, ...
1
vote
1answer
20 views

Creating an app with applescript [duplicate]

I'm trying to make an app that when opened will play an audio file that is contained in the app, but i have no idea how to do it. I know this is really vague and I apologize but any help would be ...
2
votes
1answer
35 views

Scripted vector drawing app (à la Satimage Smile)

I've used Satimage's Smile app to make vector diagrams (for technical illustrations, laser-cutting patterns, etc) via AppleScript augmented with drawing commands. It's like the opposite of PaintCode, ...
2
votes
2answers
32 views

AppleScript issues with Terminal commands

I want to run this command in Terminal via AppleScript but Script Editor doesn't like the dollar sign. It says: Syntax Error: Expected end of line but found unknown token. How can I enter this command ...
2
votes
0answers
27 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....
1
vote
2answers
54 views

Automator: Is it possible to resize an image to a maximum file size?

I have been looking around for an Automator method, whereby an image file is to be resized (reduced height and width) to a specific file size (in bytes), or a near lower-bound proximity of that file ...
2
votes
1answer
23 views

Sound balance keeps changing on High Sierra and Mojave

i have a problem that every time when i reconnected my Bose QC35 II the sound balance was to the right instead of balanced in the middle.
0
votes
1answer
57 views

AppleScript, set the position of the frontmost window, even if not AppleScriptable

I am trying to write a script to center the frontmost window of the active app, when I select this AppleScript from the Script menu in the menu bar. It should work with any app, including non-...
1
vote
0answers
29 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
1answer
32 views

Applescript : count Length

I created a code which count the length of a variable and take action regarding the length. It's work well except when I have a variable in this format : "00108030-00045C9E2638502E" 1: the count ...
0
votes
1answer
35 views

Applescript to change desktop background positioning (e.g., Fill to screen

I have the script tell application "System Events" tell every desktop set picture to "/Users/jackson/Pictures/Backgrounds/backpic.jpg" end tell end tell That changes my desktop ...
0
votes
0answers
14 views

Paint brush opacity on Photoshop with AppleScript

I am working with BetterTouchTool and I want to make a button on my Touch Bar that set the brush opacity to a certain percentage or to increase/decrease the opacity. I am not very very good in ...
4
votes
2answers
257 views

AppleScript: Wait for Safari page to fully load

I'm using this script for Google Chrome to pause the script until the page is fully loaded: tell application "Google Chrome" repeat until (loading of front window's tab 2 is false) ...
0
votes
0answers
17 views

Building up iOS device reports using Apple Configurator (scripting library)

My goal is to use the Apple Configurator 2 utility to build up system information about the iPads and iPhones which I buy in and quickly put this information into my database. Up until now this has ...
0
votes
0answers
20 views

Delete song from iTunes with partial name from clipboard

I'm trying to delete a track from a playlist in iTunes using only a partial name from the clipboard. It keeps giving me an error saying it can't find the track. I'm fairly new to AppleScript so I ...
1
vote
1answer
35 views

How to systematically change a default app for files in a given folder

I would like all of the (say) pdf files that land in my Download folder to open with (say) Acrobat instead of my default Preview (but I want to retain Preview as a default for all other pdf files). I ...
1
vote
0answers
7 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 ...
0
votes
0answers
32 views

FFMPEG batch scripting in Applescript or Automator using Terminal

I've got a problem with some malformed videos that need to be re-wrapped in ffmpeg. I can do it in the terminal straight up, but I can't seem to automate it. ffmpeg -i /Users/Home/Desktop/filename....
1
vote
1answer
39 views

Grant “Full Disk Access” to Workflows run via the Services menu

I have an Automator Workflow installed as a service, that I run via Finder → Services → My Automator Workflow. The workflow copies some files to a DOS formatted thumb drive, and them attempts to ...
0
votes
1answer
33 views

QuickTime X Applescript

(Copying this from Stack Overflow, because this might be a better place to ask) Looking for help (really to do) with a script/automator action for opening a files in QT X and using the export 720p ...
2
votes
2answers
64 views

Can AppleScript get folder contents with file extension exclusion?

Looking for a way in AppleScript to get the contents of a directory with an exclusion to parse through. I know how to do this using find in a for loop with the command: find . -not -name "*.bat" but ...
0
votes
1answer
31 views

Check automatically if a drive is mounted

I'd like to automate my family backups, specifically I'd like to run a shell script (with rsync) when an external drive is connected. Since it's a family thing, it should be also sort of GUI driven, ...
1
vote
1answer
32 views

Is usr/local/bin the correct directory to place JAR files?

I have built an application that includes a JAR file I developed and I've had issues trying to run it correctly from the AppleScript application with: set foobar to POSIX path of (path to me) & "...
0
votes
0answers
26 views

AppleScript Mail reply messages (10.13): body treated as read-only property

AppleScripting a solution for a client and having trouble with handling of outgoing messages: If I use the reply verb, the outgoing message body is treated as a read-only property and I can't figure ...
1
vote
1answer
32 views

How can I find duplicate adjacent cells in Numbers?

I have a Numbers sheet that is thousands of rows long. As an example in the image, the sheet has two columns with URLs. What I need to do is find the rows that have the same URL in the two adjacent ...
2
votes
1answer
29 views

How to get a one-key shortcut for full screening an Application (not just maximize)

In Windows there is the ubiquitous F11 functionality which on the Mac is done by ctrl-cmd-F. As far as I found there is no universal way to get a one-key shortcut. It should be possible to do with ...
0
votes
1answer
56 views

Randomize MAC Address Using Platypus [duplicate]

I am running the following script in Platypus but the MAC address does not change: #!/bin/zsh IF=en7 mac=`ifconfig $IF | awk '/ether/{print $2}'` echo "$IF mac before change=$mac" randmac=`openssl ...
-2
votes
0answers
71 views

apple script progress bar

I am using macOS Automator to create a script for rsync backup and I need it to show progress in the gear applet: The problem is no progress shows. What is the problem with my code? on run {input, ...
0
votes
0answers
25 views

How do i automate a key press by automator [duplicate]

Basically, I want to create a script that outputs certain characters in a video game. I looked up online and found out that Automator could make it happen with the help of a third-party app (BTT) that ...
0
votes
0answers
14 views

applescript claims `missing value` with UI element path it is giving me

My applescript is written as follows: tell application "System Events" get every static text of UI element 1 of row 1 of table 1 of scroll area 1 of sheet 1 of window "Settings" of application ...
1
vote
1answer
17 views

Getting process currently open in full screen mode

I have a simple AppleScript that works when initiated from an application that is not in full screen mode but does not work when in it's in full screen mode: #!/usr/bin/osascript tell application "...
1
vote
1answer
28 views

Dealing with filename extensions - bash vs oascript

I have a script than closes open windows, but it only works when I have enabled the Finder "show all filename extensions" preference. Is there a robust way to accomplish this regardless of the state ...
3
votes
3answers
427 views

Can AppleScript or any other script measure a Macbook's wifi signal strength?

At my home I have two separate routers due to poor signals when being in one location opposed to another. When I work on my Macbook from different locations I find it annoying when I have to switch ...
0
votes
1answer
39 views

Launch AppleScript when bluetooth device is disconnected

Spotify continues playing on my Mac when my bluetooth headphones are disconnected (when they go out of range or lose battery for example). I have an AppleScript to pause Spotify, and I want it to be ...
4
votes
2answers
345 views

Is there a macOS equivalent of the Windows assoc command?

I am looking to change a file association on the Mac using some sort of script. I know that I can do something like that in Windows using the assoc command. Is there something scriptable on macOS ...
1
vote
1answer
101 views

script works in Script Editor but not as app (MacOS Mojave)

The following Script works as expected in Script Editor: tell application "System Events" set nord to menu bar item 1 of menu bar 2 of application process "NordVPN IKE" ignoring application ...
0
votes
1answer
71 views

How can I check if leap year in AppleScript?

The following code is to check if it's a leap year once the program detects the current month is February. The "if" code seems quite redundant. set MM to month of (current date) as number if (MM = 2)...
2
votes
3answers
54 views

How do I check whether a file is available to download?

The following code generates a link to download the HD file from a site every day, but it doesn't know how to determine whether the link is valid or not. How do I check the validity of the link? set ...
1
vote
0answers
20 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 ...
0
votes
2answers
31 views

Can Node.js version be checked with AppleScript?

Starting to use Node.js more I was wondering if Node.js could actually be tested with a do shell but I've run into an issue. I did a search to see if this was asked but closest result was "Automator - ...