Questions tagged [applescript]

AppleScript is an end user scripting language that has been available in Mac computers since System 7 Pro (7.1.1). It allows for automation of system tasks, communication between processes, and creation of workflows, amongst other functions.

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

Adapting count for a prePend folder rename?

it's been a while, so my skills have gotten rusty, and I'd appreciate any insight I have an existing script I'm trying to adjust for a folder rename action that is based on whether or not it contains ...
Vicente MartinezJr's user avatar
-1 votes
0 answers
22 views

How can I Use a FileMaker Pro script to add a FMrecord as a calendar event in MacOS- calendar?

--I'm Using the following FilemakerScript Variabele instellen [ $Title; Waarde:"Klant " & Logboek::X & Klanten::KlantID letters ] Variabele instellen [ $StartDate; Waarde:Logboek::...
harold's user avatar
  • 1
0 votes
1 answer
23 views

Detect which anchor is selected in Security & Privacy tab

I am currently trying to detect which "anchor" is selected in the Privacy pane of Security & Privacy. With the following code, I am able to get a list of all the available anchors but I ...
nyxaria's user avatar
  • 481
0 votes
0 answers
15 views

AppleScript Assistive Error 1719 when using System Events "click"

I'm starting to loose the plot here. I have an AppleScript application that needs to use the click command for system events. When run in Script Editor, it works perfectly. When exported as an ...
Dave's user avatar
  • 11
0 votes
0 answers
16 views

Applescript to open URLs with a specific name in a new tab?

I have a very specific request because I have a very specific annoyance with one of my jobs. I grade for an online school and we have hundreds and hundreds of submissions in the web portal that we ...
Shannon McNamara's user avatar
0 votes
1 answer
20 views

Using AppleScript to run JS on Brave Settings Pages

I'm trying to get around a limitation that Brave has for extention white/blacklists. I have two conflicting extensions - one I want to run on work sites, and one on pretty much everything else (I've ...
Dave's user avatar
  • 11
-1 votes
1 answer
16 views

Automator Workflow doesn't show on Services menu in all apps

I created an automator workflow that opens a specific page in google chrome. When I assigned a keyboard shortcut to it, it only works when Chrome is the active application. How do I get this keyboard ...
Owen's user avatar
  • 79
0 votes
1 answer
33 views

AppleScript - Finder set label with absolute path

I have this working AppleScript that sets a label. But it asks me to select the file. Question: how do you specify a path to the file that you want to change the label index to, so you aren't ...
Lacer's user avatar
  • 5,680
0 votes
0 answers
18 views

Use Script editor to automatically click a certain area of the application Rekordbox and select a colour

I'm using a DJ application called Rekordbox on my Mac running Mojave. I want to be able to automate the process of clicking on the slots in the top right corner of Rekordbox and select the same set of ...
Shanman.g's user avatar
0 votes
1 answer
28 views

Applescript - Pathing to a specific (non-desktop) folder location

I am currently using this line of code: set logFilePath to ((path to desktop as text) & "crash.log") as text to path to the desktop. However, I want to path to another file path, such as ...
Spruce Studios's user avatar
0 votes
0 answers
18 views

Is is possible to run UI-based applescript without logged in user session?

I am working on end-to-end test automation that runs with GitHub actions and uses custom MacOS runner images that we have full control of. The problem I need to solve is to shake an iOS simulator ...
lub0v's user avatar
  • 801
0 votes
1 answer
45 views

sudo command no longer works in my applescript

why might this not be working anymore? did something change with background Terminal password prompting? for a few months now, I've used a script to put my macbook to sleep. I normally have sleep ...
sockrabbtt's user avatar
-1 votes
0 answers
16 views

Add a random txt file from the specified folder to the event calendar

I need a script to use with automator that can add a random text file to an event in the calendar. I can't create a script for this; has anyone done this? --set theFile to "/Volume/G/Document/...
2 votes
1 answer
66 views

Use AppleScript to fetch the price of an item in the currently open Chrome page on Amazon.co.uk

Overview So I can use Applescript to get the Title of a page using: tell application "Google Chrome" to return title of active tab of front window If I have, for example, the page https://...
Sockie's user avatar
  • 193
0 votes
0 answers
47 views

How to "send" email via outlook using python?

Accroding to Automate Outlook on Mac with Python, I've managed to create a draft window that can be send after clicking "send" button, however I want this to be completely automatic. I have ...
Cookie's user avatar
  • 253
0 votes
1 answer
24 views

Capturing a selected URL on a safari webpage to a textfile using Applescript

using SAFARI as a webbrowser, i would like to store a URL I selected with the mouse to a text file. I think thsi could be possible with the context menu (right mouse click) and the "service" ...
alex's user avatar
  • 1
0 votes
2 answers
151 views

Mac OS plist creation triggers notification

Currently I am trying to setup up some automation on my Mac using launchagent plist files and various other mechanisms provided by macOS. How I programmatically create a plist file: import plistlib ...
Creative crypter's user avatar
0 votes
2 answers
58 views

How to insert a simple delay into javascript

So I want to do some web scraping, using AppleScript to run javascript code on a webpage. I have the following code: (edited to remove proprietary data) function inputPunch(date_string) { // ...
Dyskord's user avatar
  • 365
0 votes
0 answers
28 views

Is there an option to make automator ask for specific password to proceed

I have an automator workflow, that I want to make unworkable without specific password: is there an option to do it? I've tried to use "Ask for text" action, but there is no option to ...
John Smith's user avatar
0 votes
1 answer
22 views

Toggle "Show scroll bars" radio buttons in Appearance section of System Settings via AppleScript

I need to write AppleScript that sets some value to Show scroll bars in new System Settings UI. Screenshot of what I want to change in result Here's a code with which I did come up tell application &...
danulqua's user avatar
1 vote
1 answer
55 views

Automating import of songs from a list into iTunes?

All my music is kept in a folder on my external HD called 'General Music'. I have a list of selected songs in a text file called 'SL'. I really want to import them into Music into a playlist called '...
tardy pigeon's user avatar
0 votes
0 answers
22 views

Why does AppleScript fail to change the desktop wallpaper when running from a full-screen mode window, even though it runs without any errors?

I'm testing an AppleScript to set a picture as my desktop wallpaper. When I launch it while my desktop is active and visible, it works well; the picture sets quickly. However, when I execute this ...
Eugen N's user avatar
  • 33
0 votes
1 answer
41 views

AppleScript handlers with whitespace in parameter names and without "given"

I read about interleaved- handlers and parameters in handlers in Apple's documentation, but I don't know why some specific open-source code is working for others while not for me. In the documentation ...
Cocktail's user avatar
0 votes
2 answers
42 views

It is possible to write an Applescript droplet which can take mp3 files and retag them based on the file's name?

Is anyone able to write an Applescript as the basis to create a droplet app that when I drop a bunch of mp3s on it, it uses the filename pattern "TITLE - ARTIST - YEAR" to change the id3 ...
tardy pigeon's user avatar
0 votes
0 answers
22 views

Can the data of an Apple Keynote chart be changed from AppleScript?

I would like to write a script to generate a keynote presentation to animate a data set on a chart by building one slide per change in the data. The starting point would be a keynote presentation ...
Ian's user avatar
  • 1
-1 votes
1 answer
32 views

Toggling a radio button (actually checkbox) with Applescript in System Settings (MacOS 13.4.1)

How do I access the Checkbox in System Settings -> Accessibility -> Pointer Control -> Alternative Pointer options? This is failing to find it.. I've tried the anchor name. Is it because its ...
willwade's user avatar
  • 2,028
0 votes
0 answers
25 views

Applescript rename file (increment) error number -1728

I wrote a small script just to incremente a series of file names. I want to get a file named "111 - something.pdf" and rename it to "112 - something.pdf" But for some reason I'm ...
alexandrecfb's user avatar
0 votes
0 answers
30 views

Automating IKEv2 VPN Connection & Enabling Killswitch on macOS Boot

Hey StackOverflow community! I've been grappling with a challenge of automatically connecting to my IKEv2 VPN on macOS boot and concurrently triggering the command sudo killswitch -e to block all ...
Ilya Y's user avatar
  • 754
0 votes
1 answer
38 views

Applescript - How to paste Notes compatible RTF

I have an AppleScript app that would like to create a note (in Apple Notes) that uses the checklist feature. Apple Notes apparently uses a special version of Rich Text Format (RTF) (com.apple.notes....
user1092808's user avatar
1 vote
1 answer
40 views

AppleScript - cycle through desktops

I am writing a script that will cycle through desktops on macOS I try to move between desktops using shortcuts "ctrl+right" and "ctrl+left", which I set up on my machine to move to ...
alex440's user avatar
  • 1,647
0 votes
1 answer
55 views

Applescript to open two applications in the same full screen mode (side by side)?

I would like to open in full screen mode two applications side by side. For example, Calendar and reminders in full screen together. One example I have seen and use is this: tell application "...
Ricardo Brugos's user avatar
0 votes
3 answers
50 views

Robust way to close multiple tabs/windows, by their title, in Chrome using AppleScript?

I want to close all tabs in Chrome that have a specific title using AppleScript. I came up with this code but it doesn't feel robust: tell application "Google Chrome" set tabsToClose to {...
d-b's user avatar
  • 695
0 votes
0 answers
19 views

Chrome's support for AppleScript buggy or why does it mix up which window that has focus?

I have an AppleScript (AS) that opens two windows in Chrome, one normal and one in incognito mode (because some things need each type of window). The whole script performs in an infinite loop. Here is ...
d-b's user avatar
  • 695
0 votes
0 answers
20 views

How do you use a JavaScript module with AppleScript in a browser?

Usually when you script a browser using AppleScript (AS) and want to send a JavaScript (JS) snippet to be executed you just send the JS as text to the browser using something like do/execute ...
d-b's user avatar
  • 695
-1 votes
3 answers
41 views

AppleScript, manipulate the return value from a one-liner tell-statement, still on the same line?

tell application "Finder" to get bounds of window of desktop returns something like {0, 0, 1440, 900} How can I do something like get item 3 of (tell application "Finder" to get ...
d-b's user avatar
  • 695
0 votes
2 answers
78 views

Split any file in multiple files after a specific text string [closed]

I have a single .dat file that consists of a lot of webp images. I would like to split that file everytime before the string WEBM and safe that portion as a .webm file. I would love to do this with ...
Maximilian Becker's user avatar
0 votes
0 answers
36 views

applescript - move every file into its parent folder, but skipping existing files if they already exist

I have this script to choose a folder and then move the contents of the subfolders into it. tell application "Finder" set top_folder to (choose folder) repeat with this_folder in (...
frumbert's user avatar
  • 2,341
0 votes
0 answers
13 views

Hide network drives with AppleScript

is there a way to do so in as? Background: I don't want to show network drives which are not used from a user. I know how to mount drives tell application "Finder" try set userName to do ...
McProgger's user avatar
0 votes
0 answers
38 views

Using Applescript to open an excel file and enable macros in MacOs

How can I use Applescript to open an Excel file in MacOs and enable the macros? I have tried : -- Set the path to your Excel file set excelFile to "/Users/spagcoder/Desktop/proms webform/PROMS....
SpagCoder's user avatar
0 votes
0 answers
43 views

Unable to control full screen menu bar visibility on MacOS using CLI defaults

I'm trying to programmatically (shell) control MacOS auto-hide feature of menu bar, but could not find working solution. For controlling manu bar auto-hide on regular desktop I can use AppleScript ...
krzychek's user avatar
  • 300
0 votes
0 answers
75 views

AppleScripts won't let docker run on my mac

I foolishly listened to ChatGPT and ran an applescipt command without completely knowing what it would do. The command was osascript -e 'quit app "Docker"' which I thought would simple force ...
Jhirschibar's user avatar
1 vote
0 answers
71 views

Using Applescript to run an Excel macro

I want to schedule an Excel macro to run every week on MacOS. I am using Applescript but when I run the script, it seems to open the file but the macro doesn't run. Also, how do I automatically enable ...
SpagCoder's user avatar
0 votes
0 answers
58 views

Roblox Macbook Script Editor (Applescript) Text to Write but with Numbers

So I've been using applescript to script music for Roblox Piano, but I've noticed that it doesn't repeat numbers. Is there a way to include numbers? Although I swear the "characters" ...
Dim Sum_'s user avatar
0 votes
0 answers
47 views

ZSH osascript tell parent application (process) display dialog

I have an AppleScript application that runs a do shell script of my script.sh in the application package. That my script.sh does some interaction with the user through $osascript -e 'tell me to button ...
Greg's user avatar
  • 33
0 votes
0 answers
32 views

Is it possible to extract mails from Outlook automatically on Mac?

I am trying to export mails from Outlook on a Mac using AppleScript as it does not work with VBA. However, I don't progress a lot, the text files are not saved to my Desktop and that's why it always ...
ph13's user avatar
  • 7
1 vote
1 answer
29 views

Calling a angular frontend from applescript to select an item from a list

I have an angular server running in the localhost, and I want to call it from Applescript. The scenario is I have a list of tweet IDs inserted as a list in angular, and it's running as localhost. Now, ...
Gautam Shahi's user avatar
0 votes
1 answer
23 views

AppleScript only runs on startup but stops running after some time

Im trying to write an AppleScript that opens checks if the battery is charging and opens AlDente if it true and closes the app if the battery is at a certain percentage or not charging: on ...
Ruvimbo Dube's user avatar
0 votes
1 answer
21 views

AppleScript - How to take row 1 and use as file name and row 2 for content to create json files

I have a large amount of data (367 columns of two rows, but row 2 has a lot in it!) to export into json files for web display. I'm trying to automate the process of saving each one as a .json file - ...
James Davies's user avatar
0 votes
1 answer
72 views

Python string to formatted text in Apple Notes?

I've written a Python script to extract notes and highlights from my kindle. Now I would like to create a formatted string that I can write from Python to my clipboard, and then ideally paste into ...
Nick-H's user avatar
  • 342
0 votes
1 answer
35 views

AppleScript: "Can't make «handler generateNo» into type text" but it is a string?

I call a method like this: inputByName("number", 0, my generateNo as text) generateNo is a method that creates a string with numbers generateNo () set theString to "1234" ...
d-b's user avatar
  • 695

1
2 3 4 5
175