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.

1
vote
0answers
3 views

What does “Cache location entry for Photos.app in cache file” error signify in Automator app?

I have written a very basic script to count the number of files in a folder, then if it reaches 16 files, to run an automator workflow, as below: #!/bin/bash cd /Users/barbooths/Projects/...
0
votes
0answers
5 views

how to update date in Pages template with applescript

I'm trying to update the date of a Pages template using a script. The date was inserted from the Insert menu. (see https://support.apple.com/kb/PH26836). It seems like Pages considers it to be a ...
-1
votes
0answers
22 views

How to click on an html link using AppleScript

I'm trying to click on the link below using AppleScript and JavaScript, but can't figure out the method. The code snippet below has the link I want to click. The link changes every time, so I would ...
0
votes
0answers
19 views

Disable the creation of “Icon?” file on Mac

I'm using Google Drive on Mac and every time I create a new folder, it also adds a hidden "Icon?" file which I've read more about on Stackoverflow. It causes some issues and I'd like to disable this ...
0
votes
2answers
16 views

Possible to change the visibility of a column in finder with AppleScript?

When I change the visible property of a Finder column to false it does not have any effect even after closing and reopening the window. tell application "Finder" activate set visible of ...
0
votes
0answers
10 views

click debug memory graph button using apple script failed to get the button

this is the button in accessibility inspector: this is my code tell application "System Events" tell process "Xcode" activate click button "Debug Memory Graph" of group 2 of ...
0
votes
0answers
7 views

Calendar + Automatically Duplicate Entries in Different Calendar

This might be an odd question, if what searching the web has turned up so far is any indication. When I enter a calendar event, I would like Calendar.app to create a duplicate entry in a different ...
0
votes
1answer
19 views

How to manually “file” files into folder, quickly, only using the keyboard

I'm working to set up a paperless filing system. Although I've got several pieces in place, one of the parts that slows me down the most is putting a scanned file into the right folder. Find the ...
0
votes
1answer
22 views

How to refer to Applescript dictionary objects with spaces in the name

I'm trying to write an Applescript that accesses EyeTV (yes, I still have one running!). I'm trying to list the recordings in the programs window. From the dictionary: application n [see also ...
0
votes
1answer
16 views

Refreshing Finder window view after sorting files

I have a simple script: tell application "Finder" activate set sort column of list view options of Finder window 1 to size column end tell It works, but the problem is that the window is ...
0
votes
0answers
5 views

Skim - Changing highlight colors with keyboard

I have been trying to build a script that allows me to easily change the highlighter color in Skim by keyboard shortcuts. If the keyboard cannot be used in the script, I do have Keyboard Maestro, so ...
0
votes
0answers
10 views

How to automatically attach folder actions to all added subfolders recursively?

TL;DR How do you make a folder action that attaches folder actions to added subfolders? Is that even possible? My end goal is to convert gps/location-based reminders of specific locations (e.g. home/...
0
votes
0answers
13 views

Applescript not working on High Sierra

I created an applescript code to help rename a bunch of images and create a text file with the file names and dimensions so we can send out to another team to program into an email. The code worked ...
0
votes
1answer
34 views

Batch Reformat Date in Filenames

I am in need of a solution that will allow me to batch reformat/rename the date appended at the end of a filename and then move the date to the beginning of the filename. I'm adopting the ISO 8601 ...
1
vote
1answer
22 views

Get values from Numbers.app into AppleScript's variables

I have a .numbers file in following format: Product Quantity Price Apple 5 3 Banana 7 2 Orange 3 4 I need to get three variables with new-line separated values, e.g. ...
0
votes
0answers
17 views

AppleScript on AppleMail action

Found a script to create bulk e-mail distribution: on run {input, parameters} set addresses to "aa@example.com bb@example.com" set names to "Ann Bob" set title to ...
0
votes
1answer
22 views

Determine com.apple.Finder AppleShowAllFiles status using command line?

Is there a way that I can grab the status of com.apple.Finder AppleShowAllFiles in command line? I switch between AppleShowAllFiles yes & no frequently, I want to write a .command file to check ...
0
votes
0answers
10 views

Hide System Preferences icon from dock during AppleScript execution

I have an AppleScript scheduled to run every several minutes with launchd. The script makes some adjustments in System Preferences. However, whenever it runs, the System Preferences icon appears on ...
0
votes
0answers
15 views

Automator Workflow or Apple Script to move files

I've got a MS Excel Macro enable file that reformats a csv file to a particular format and writes a new file to a folder in /use/library/group containers. It has to write it here because of the ...
0
votes
0answers
8 views

Applescript Powerpoint to create a new presentation from selected slides

I'm having a hard time believing this isn't a command directly in Powerpoint, seeing as the one thing I hear more than anything is "can you send me just that slide?". But MS isn't exactly known for ...
1
vote
1answer
20 views

What is the difference between `on` and `to` in AppleScript handler declaration

What is the difference between on and to in AppleScript handler declaration? When to use one or the other? For example the following handlers do the same: on demo1() return 1 end demo1 to demo2()...
0
votes
0answers
29 views

How to pass a record or a list to an AppleScript handler in VBA AppleScriptTask?

is it possible to pass a record or a list to an AppleScript handler in VBA AppleScriptTask? I have a handler which moves a given file or folder from a source to a destination: on moveFSObject for ...
0
votes
1answer
25 views

Running AppleScript without activating the window

I have a python script to read from Messages database and forward some specific new messages to specific contacts. It works but the AppleScript below to send message is making Messages.app appear. I ...
2
votes
1answer
39 views

Click check buttons via keyboard or script

I'm using Final Cut 7 under El Capitan, and I need to check the following buttons (in fact just the Audio Tracks, but both would be nice) using the keyboard, or maybe a scripted method. I have ...
2
votes
0answers
18 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 ...
1
vote
0answers
30 views

How to remove a large number of unused keywords from Apple Photos app?

My Photo library has evolved over many years, starting out as an iPhoto library, then being merged with an Aperture library, then becoming a Photos library. Over the course of the last 20 or so years ...
0
votes
0answers
19 views

AppleScript with list selection and Cancel button suppressed or disabled

Is there any way to suppress/disable the Cancel button in a list selection dialog - in other words, force a response? Here's what I came up with (I'm forcing a response by displaying an error message ...
0
votes
2answers
26 views

Trying to click a button in safari

I'm trying to click a button in a webpage with AppleScript, but it only seem to work 1/10 times. I copied this code, to clickID(theId) --creates a function that we can use over and over again instead ...
3
votes
1answer
113 views

Applescript to mute Discord

Edit: My initial question does not appear to have a solution. Instead I used an alternate method. Scroll down to see the alternate method. I'm looking for a solution to mute my mic in Discord that I ...
2
votes
1answer
34 views

AppleScript checking if folder exists causes “AppleEvent handler failed” error -10000

AppleScript on macOS Mojave and can't work out why this script gives the expected "TRUE" on the first folder, but instead of "FALSE" on the second folder it aborts with the error message: [error "...
0
votes
0answers
16 views

AppleScript: Can I 'get' highlighted text from Mail.app?

I'm trying to make a script that takes selected text in Mail.app, gets it into the script and does some processing to it. I don't want to have a GUI script that emulates command-C to copy the text ...
0
votes
0answers
22 views

Use AppleScript to search for message by subject

Does Applescript provide a mechanism for me to search for a message by subject; or do I have to write a loop and examine every message "by hand". The code below generates this error: Mail got an ...
1
vote
1answer
15 views

How to iterate over Reminders using AppleScript

I'm trying to write an AppleScript that simply iterates over uncompleted Reminders and displays the name. The code below generates this error: Reminders got an error: Can’t make name of reminder (...
0
votes
1answer
12 views

Move mail message back to inbox of Exchange account

Is there a special syntax for using AppleScript to move a message from a folder back into the inbox of an Exchange account? I have Apple Mail configured with three accounts, two Gmail accounts and an ...
0
votes
1answer
32 views

How to batch add folders to Folder Actions

I actively manage a directory of folders that contain images that are organised by modification dates. Due to this, I had made a quick action that used an applescript and bash to help me ensure that ...
0
votes
0answers
20 views

Find all object to be targeted by the command

I begin in AppleScript and I learn the Anatomy of a Command from here. I see that the move command requiem an object (In the example is Folder). But how to find all available object of any command? ...
2
votes
1answer
22 views

Automator: `command not found` (Python script for command line) [duplicate]

I am trying to create an Automator application, which allows me to convert Python script files .py files to Jupyter Notebook files .ipynb using Python script for command line jupytext. However, the ...
1
vote
1answer
20 views

Terminal command to get app switcher information?

The native app switcher orders the apps based on chronological focus. This ordering is useful to me for a script, but I'm not sure where this ordering information is stored. Is there a way to get the ...
1
vote
2answers
50 views

Changing AppleScript-created date-based folder structure

I have an AppleScript that has been written and it works as such, but I need to change the way it creates the folder structure. The script does the following: Folder is selected which contains files (...
1
vote
1answer
29 views

Automator to open random file on Windows share

I have created through automator the ability to locally open a random file in a specified folder with subfolders. I cannot figure out how to do this on a networked Windows share. I have: Get ...
1
vote
1answer
41 views

Why is an AppleScript to modify Calendar event attributes so slow?

I'm trying to write a fairly simple AppleScript to automate the process of having Calendar events repeat in bulk. Specifically, I want every event on a given calendar within a given time span to have ...
1
vote
0answers
19 views

AppleScript grab value from safari with repeat / add in list

I need to grab data from a safari, There is a random number of : document.getElementsByClassName('sortable DataSummary')[1] this work fine : tell application "Safari" set mzRawData to do ...
1
vote
1answer
98 views

AppleScript to perform actions to text in new TextEdit document

I need to make an AppleScript that would create a new TextEdit file, type any random text, then a table would pop up and give you two options to choose font of that text, then same with colour, save ...
1
vote
2answers
116 views

Launchd running an Applescript every two hours

I have written a small applescript that I would like to run automatically every 2 hours. I have thus written the following launchd daemon (probably it is an agent): <?xml version="1.0" encoding="...
3
votes
1answer
42 views

Applescript : generate a new list based on existing list

my script is generating a list (random number of items) and for each item I like to add a colour. I can do it manually : > set myList to {{"demo", "#5cdf64"}, {"icloud.com", "#FFFF00"}, {"more &...
-1
votes
0answers
21 views

Creating a new tab at specific position using JXA

I've been trying to see if it's possible to re-create this AppleScript that was posting on Daringfireball here. tell application "Safari" tell front window set _old_tab to current tab ...
2
votes
1answer
67 views

Apple Script: Can’t get date of “2018-12-12 10:00 AM”

Script Purpose The script below uses an App called Pashua to display a custom dialog box that returns multiple inputs. These inputs are then used to create a new Calendar event. The Issue The ...
1
vote
2answers
71 views

Can AppleScript search deeply for the largest file contained below a folder?

I need to make an AppleScript that would find the biggest file in selected directory (even if its inside another folder) and show full path on screen. This is what I have so far, but it doesn't work:...
3
votes
1answer
49 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 ...
2
votes
1answer
48 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" & ...