Questions tagged [applescript]

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

285 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
24 views

How to run an AppleScript from a Mail rule when screen is locked

I wrote an AppleScript to send an email with a hashtag in the subject to trigger@applet.ifttt.com and I created a Rule in Apple Mail to run the AppleScript when a new mail is from a specific sender ...
0
votes
0answers
57 views

Applescript temporarily stop user input/detect through mouse and keyboard

I've looking through apple forums and here looking for a solution. The only solution I could find was to permanently disable the built in Keyboard (which is clearly not a great solution). Can anyone ...
0
votes
0answers
41 views

Syncing and deleting categories in Outlook?

I created a bunch of Outlook categories via AppleScript using the following command: make new category with properties {name:"Snooze2", color:"blue"} These new categories work as expected, but don't ...
0
votes
0answers
51 views

Applescript refer to a tab

I'm trying to find a tab on safari and save the tab number. This work fine : tell application "Safari Technology Preview" repeat with w in windows if name of w is not "" then --in case of ...
0
votes
0answers
22 views

Is there a way to signify a wildcard placeholder when recording a workflow with Automator?

I have a task that is very repetitive, with only a few minor caveats. Usually, the caveat is as simple as a name change, but the task jumps between Finder, Xcode, and uploading files via a storage ...
0
votes
0answers
130 views

Run AppleScript in background without showing in app switcher?

Is there any way to run an AppleScript command (which runs infinitely) completely in the background without any icon showing in the dock or app switcher (⌘+Tab)? For example, hiding the AppleScript ...
0
votes
0answers
43 views

How to force Safari to open links clicked in other apps in a “public” window

I wrote an AppleScript (saved as an app) awhile back that opens a new Safari Private window to a web-app site that requires a private window in order to have multiple windows to that site open and not ...
0
votes
0answers
14 views

Run Automator service when program cannot access accessibility services

I've read this: How do I assign a keyboard shortcut to an AppleScript I wrote? The app I am trying to add the service to under Accessibility does not allow me to see the service. It's a game running ...
0
votes
0answers
108 views

I want to prevent the Touch Bar from sleeping when left inactive

I just bought a new MacBook with Touch Bar and when ever I'm watching something, or the Touch Bar is left inactive, it dims and sleeps which is really annoying to me. Is there any terminal command or ...
0
votes
0answers
19 views

Software or applescript for generating web loc links for files in a folder

Is there a software for Batch generating web loc links for specified folder? Input Folder1 -- file1.pdf --- Folder 1.1 ---- file1.1.pdf Expected Output Folder1 (Folder ) -- file1.webloc --- ...
0
votes
0answers
48 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
0answers
47 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
0answers
46 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
50 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
74 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
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 ...
0
votes
0answers
22 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
0answers
97 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
0answers
42 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
0answers
235 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
0answers
50 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 ...
0
votes
0answers
36 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
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 ...
0
votes
0answers
16 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 ...
0
votes
0answers
48 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
0answers
17 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
122 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
0answers
37 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
282 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 ...
0
votes
0answers
39 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?
0
votes
0answers
83 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 ...
0
votes
0answers
112 views

How can I “listen” for a VPN disconnect via Applescript and reconnect to the VPN when that occurs?

I have an Applescript that will connect my VPN profile when my computer boots. However, if my computer sleeps, the VPN connection is broken and the script doesn't reconnect it. Also, if there is a ...
0
votes
0answers
190 views

AppleScript Database Events, SQL query

I'm discovering Database Events and I created a script to store data daily: tell application "Database Events" tell database "Stats" set theRecord to make new record with properties {name:...
0
votes
0answers
59 views

AppleScript : Track change (time tracking)

I have an app which display the number of minutes passed within a specific status for e.g I'm online now since 102 min , the result of my script return {"Online for 102:40"} How can I get the value ...
0
votes
0answers
60 views

How to add title metadata to videos with AppleScript?

Moving to a Plex Media Server I realized a majority of my video archive doesn't have metadata and when I render the videos through Plex's UI I see Episode # when I want it to render as Episode Foobar. ...
0
votes
0answers
117 views

AppleScript UI for Notability

Okay, using a program called "Notability" for taking notes now. I would like to create a shortcut for changing text colors, etc. However, I'm having trouble scripting the UI. The changing colors is ...
0
votes
0answers
41 views

Applescript to turn HDDs off during day, and back on at night

I figure I should ask my first question, I'm curious to see how an Applescript could control my HDD that my TimeMachine is backed-up on to un-mount during the day, and back on before the scheduled ...
0
votes
0answers
56 views

How can I get an image selection programmatically?

I need to log the bounding box of the selected area from an image to the command line. This is because I will have to do this across a number of images and then compare and reuse those bounding boxes....
0
votes
0answers
60 views

Click on a button using mail rule & Applescript

I wrote this to push on a button, and it's work fine when I run the script, however when I run the script from mail (trigger from a email rule) nothing happen. Is this due to an Applescript ...
0
votes
0answers
77 views

Automator script not working

I've created a new automator Service. This service executes the following AppleScript: on run {input, parameters} do shell script "open ~/" return input end run If I execute this ...
0
votes
0answers
72 views

How to get AppleScript to log the display name of user triggering an Adium event

In the Adium chat client, each contact includes a number of event hooks via the "Get Info" window for a contact: Contact becomes idle Contact goes away etc. Each of these events allows you to hook ...
0
votes
0answers
62 views

Is it possible to trigger a script on a notification center notification?

I'm trying to hook into a "finished" event from a program that doesn't provide any native way to do it. It does, however, post a notification to the notification center. So I'm looking for a way to ...
0
votes
0answers
209 views

Using AppleScript to convert MP3 to WAV via Finder?

How would I use Automator/AppleScript to convert a selected bunch of MP3s to WAVs (from folder1 to folder1 - so retaining original folder), please? I'm running High Sierra and would prefer not to ...
0
votes
0answers
72 views

Encrypting data string using public key then save to variable

My scenario is a little different to existing Q&As on this topic and perhaps belongs into more than one category but as the following code is AppleScript / Shell based, I figured this is the place ...
0
votes
0answers
81 views

How to use big integers in AppleScript?

How can I make a large integer in AppleScript? I suppose there is a certain byte limit which doesn't allow me to work with enormous numbers. Is there any way around this except for using a float?
0
votes
0answers
33 views

Applescript: Apply mask to an image in Pages

Is this possible? If yes, how? What I want to do: I want to apply rounded corners to an image (pdf format) which I use in a pages document. I am searching for a way to automate this process, wether ...
0
votes
0answers
88 views

How do Skim's bookmarks work?

I'm using Skim to add bookmarks my pdfs and have some questions: Skim seems to have it's own bookmark manager with folders and bookmarks that allow you to open bookmarks inside pdfs that aren't ...
0
votes
0answers
747 views

“Ask for Finder items” in automator folder action doesn't show up

In my folder action, I added "Ask for finder items" action (asking for destination folder for move operation) after filtered items from the folder got stored in the variable. Whenever I add file to ...
0
votes
0answers
29 views

Source Control for iWork Files

Bottom Line - Source Control for iWork files in organised folder structure. Background - Our work has moved to iWork as the primary office suite. And one of my irks is that we have way too many ...