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.

0
votes
0answers
6 views

Applescript Getting all occurence of ClassName

I need to get all the text (numbers) which have the same classname and add them to a list. Here is the html tag <td class="sortable PersonID"> 1545486 ...
0
votes
0answers
8 views

AppleScript that responds to system notifications?

Is there a way to respond to a notification that is created by a specific application? I'd like to do something like this: if the application that created the notification is X if the text of the ...
0
votes
0answers
12 views

How to keystroke inside parallels virtual machine?

I have windows 10 installed on my mac using parallels desktop. I want to send a key combination to windows machine for navigating between browser tabs (opened inside virtual window 10) from mac using ...
0
votes
1answer
21 views

AppleScript : CMD + S

I can't manage to keystroke Command + S on an app, it's seems to trigger "Save AS" instead of "Save" tell application "TextMate 2" activate tell application "System Events" ...
1
vote
1answer
60 views

AppleScript add new filename and path in mail only when files extension are .pdf and .doc

I have a Mac running macOS Mojave. this script sends a mail to multiples user when someone adds a new file in my folder. How can I add the filename in the mail Subject and the path file in the mail ...
0
votes
1answer
15 views

Launch Apple Music radio station directly from command line

I'd like the most direct way, on a Mac, to launch an Apple Music "radio" station e.g. via the command line, without having to manually navigate to the radio tab in iTunes, waiting for it to load, ...
0
votes
0answers
22 views

Finding a file in Finder with a script

someone please explain why this won't work. The script alone without the "if mainReturned = "File" then" works just fine but when I add it to another part of a script, things get weird. It highlights ...
2
votes
2answers
46 views

Opening a script with a script?

I am using a script and I have a secret code to input within the script (If that makes sense) after I input the code, it is supposed to open the script within the application, the main.scpt. I don't ...
0
votes
0answers
13 views

How can I set a file password for a Numbers file with AppleScript?

Is it possible to activate the password protection (that is available in the file menu, like described here) of a Numbers file via AppleScript? And if yes, how? As an alternative: could this be done ...
0
votes
1answer
60 views

Use AppleScript to raise and focus on window

I'm new to AppleScript. I'd like to write a piece of AppleScript that will raise and give focus to a particular Chrome window given a string that appears in the window name. After poking around a bit, ...
0
votes
1answer
29 views

AppleScript / Javascript : remove columns in Safari

Is there a way to remove all instance of a class in safari using AppleScript/Javascript ? For e.g I would like to remove each instance of : `<td class="sortable cardTypeDisplayName"> ...
1
vote
1answer
50 views

How can I manually switch to the next Desktop wallpaper in Mojave?

I have attempted to use this AppleScript to to cause the Desktop wallpaper to change to the next image in the folder of images that has been selected in System Preferences. It does not work for me in ...
1
vote
0answers
18 views

Custom time limit rules for macOS apps

My child has a MacBook that is required at school. I'd like to set rules around my child's usage of certain apps for, shall we say, non-academic use (games), while still allowing him to use the ...
0
votes
0answers
17 views

Keynote Automation using Applescript/Java

I'm looking to create an AppleScript to automate my Keynote workflow. Basically, I want to replace a marker in the Presenter Notes with text from a table (Numbers, Excel, or other). I found this ...
0
votes
2answers
61 views

How to modify cupsd.conf on 50+ machines

I need to modify the cupsd.conf file (removal of PAUSE-PRINTER/RESUME-PRINTER) on 50+ machines to allow non-admin accounts to resume the print queue. Is there a way I can script this (through ...
0
votes
0answers
5 views

Programmatic (AppleScript) access to notification centre history

I have followed this thread, which addresses active notifications which appear on the desktop: How do I clear All OS X notifications with 1 click?. These solutions offer programatic approaches to ...
0
votes
1answer
15 views

Apply automator action to original instead of copy

I'm trying to make a simple action to scale down an image by 50% but keeping an original copy of the file in the same directory. I easily made an action similar to what I want that produces two files: ...
0
votes
0answers
29 views

PowerPoint's save as PDF in AppleScript results in print job

I have a small AppleScript to save a PowerPoint pptx file as PDF from command line. I use the script every 6 months, and last autumn it still worked. But today I run into problems. I updated to 10.14 ...
1
vote
1answer
48 views

Possible to Disable Screensaver?

What I'd like to achieve On my Macbook Pro with latest macOS - every X minutes, the screensaver turns on for X seconds, then the screensaver turns off. This application by defaults runs every time ...
0
votes
0answers
29 views

OSX Mojave + Automator - run AppleScript as Keyboard Shortcut Service

I am looking to create an AppleScript that allows me to open up a new finder window pointing to Desktop from anywhere in the system, preferably without having to use any thirdparty apps. Ideally the ...
0
votes
1answer
34 views

Why repeat a try statement in AppleScript before returning an error?

I’m trying to learn AppleScript and have seen the following example for the Photos app: try set thisId to id of item 1 of sel on error errText number errNum display dialog "Error: cannot get ...
-2
votes
0answers
16 views

Find the location of an applescript based on logfile?

I have some malware on my MBP. It looks like an appelescript that opens safari and chrome if I quit them, and redirects google searches to bing. I found the log for the applescript, picture below, ...
0
votes
1answer
28 views

Applescript / Javascript : select menu

I'm filling a webpage using Applescript / Javascript, one of them is a dropdown menu, which I fill with this code : document.querySelector('select#reasonPopUpButton').value = '18'; the issue is ...
0
votes
0answers
13 views

How to open a second finder window in split view when the current window is in full screen view

Let's say I have a finder window open in full screen view. I'd like to quickly open a second one, where both would be in the same split view. Sort of like using command-tab. And preferably to the ...
1
vote
1answer
67 views

Automator: Move files into new subfolder based on file's name

Disclaimer, this may not be something Automator can do. I have a large directory of movie files. In order to use a piece of software, each movie needs to be in it's own folder. I'd like to create ...
0
votes
0answers
16 views

How and why is the osascript command loading a QuickTime component?

I'm trying to figure out what the osascript command is doing under the hood. Whenever I run it, it tries to load a QuickTime component which throws security errors with Mojave installed. See this ...
0
votes
1answer
35 views

QuickTime component causing errors when running osascript command

If I run a simple osascript from the command line: osascript -e 'tell app "Safari" to activate' I get hundreds of this error: 2019-01-19 13:07:31.224 osascript[3908:9313907] Error loading /Library/...
2
votes
1answer
52 views

Notification center documentation for applescript

Where can I find documentation for notification center method and properties to use it in applescript? I can't find anything in script editor's dictionary neither on web. This is example code to work ...
0
votes
0answers
17 views

Simple AppleScript exporting to Application does not work

I have created a simple script that takes some parameters as input, opens a new iTerm2 window and executes them. The script is fairly simple: on run argv set argList to {} repeat with arg ...
1
vote
0answers
27 views

Keyboard shortcuts for non-menued items Preview?

I am trying to create a keyboard shortcut action for Preview, namely Draw and Sketch. However, they are are the NON-menued items, which means can't get it done in System Preference I see someone done ...
1
vote
0answers
19 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
10 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
vote
2answers
24 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
20 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
14 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
3answers
54 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
27 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
23 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
15 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
13 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
20 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
38 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
48 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
21 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 ...
1
vote
1answer
47 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
14 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
20 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
16 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
28 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
38 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 ...