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
0answers
45 views

Opening specific URL in a not-default browser no matter from where it's called from (without using Choosy app)

I need a certain URL to be always opened in a browser that's not systems default browser. Problem is, that this should happen even if the URL is called automatically from within a hardcoded 3rd party ...
0
votes
1answer
38 views

How do I unhide columns in Numbers using AppleScript?

How do I unhide columns in Numbers using AppleScript? I created a custom shortcut so that ⌘+U unhides all columns, so I have tried this so far: tell application "Numbers" open POSIX file "/path/...
0
votes
1answer
32 views

How do I open a OneDrive file in Preview using Applescript?

How do I open a OneDrive for Business file using Preview using Applescript? I’ve tried this so far: tell application "Preview" to open POSIX file "Users/myname/One Drive - MySchoolOrCompany/path/to/...
3
votes
2answers
569 views

In iTunes 12 on macOS, how can I reset the skip count of a song?

Everything I can find on the internet seems to refer to a different version of macOS/iTunes than the ones I'm running. I want to reset the skip count of tracks without resetting their play counts, as ...
1
vote
1answer
82 views

Applescript - Automator - tomorrow keyboard shortcut

I've been able to successfully create a keyboard shortcut from a "quick action" in Automator based on running AppleScript (inserts current system date). However, I cannot get a similar script to work ...
0
votes
0answers
40 views

Switch to left or right window in split view

Is it possible to create a shortcut to activate the left window in a split view? I.e. to switch to the left window if the right is currently active, or do nothing if the left window is already active. ...
0
votes
2answers
159 views

How to get error status back to bash from osascript

Inside a bash script, I'm closing the front window of whatever application is foreground. I'd like to know if the command failed (when the foreground application doesn't have a front window. I tried ...
1
vote
0answers
29 views

AppleScript : cleaning text

Is there a way to remove some occurrence of a variable within a text without knowing where the variable is in the text ? e.g : IP= DA, null, var to be removed from the text : ", null," I ...
1
vote
0answers
20 views

Add fileserver to favorites in Finder, preferably scripted

I'm splitting my main office network into different segments with each their own subnet. This will cause our file-server (which will be moved to a different network than the users) to not appear under ...
0
votes
0answers
16 views

How can i open a URL in Chome Incognito using Applescript? [duplicate]

I want to create a Applescript for open a URL in Chrome Incognito, but i cant find how to do that, always the incognito open, but the url load in normal tab. Any ideas? Thanks.
2
votes
0answers
38 views

How can I make this script faster?

Below is a script intended to press the up arrow key every time a pixel of #535353 is encountered at 555,888. This is intended to create a bot for the Chrome dino game. However, for some reason the ...
0
votes
1answer
289 views

error “System Events got an error: Can’t get application process \”System Preferences\“.”

When running tell application "System Events" click button "Turn Bluetooth Off" of window 1 of application process "System Preferences" end tell I get the error: error "System Events got an ...
0
votes
0answers
34 views

AppleScript get text from safari (unknown index)

How get I get the value of the class "value" in the following e.g <div class="related-info-ind component" id="fsdfdsf-sdfsdf-sdfsfgge-wegdsf-gdssdgf" data-ok="0" data-neut="0" data-detected="0" ...
0
votes
0answers
19 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
46 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
58 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
29 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
101 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
74 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
30 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
54 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
20 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
171 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
41 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"> ...
2
votes
1answer
161 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 ...
0
votes
0answers
81 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
75 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
33 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
21 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: ...
1
vote
0answers
93 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
117 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
227 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
60 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 ...
0
votes
1answer
56 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
45 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
424 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
28 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
142 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/...
3
votes
1answer
267 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
24 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
36 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 ...
3
votes
1answer
96 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
15 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
37 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
44 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
73 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
68 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
36 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 ...
1
vote
0answers
36 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
1answer
41 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 ...