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.

3
votes
2answers
29 views

How to force quit an AppleScript script launched from toolbar?

I have an AppleScript script (to launch MySQL) that I run from the AppleScript toolbar menu. It does the job (launches MySQL), however the script doesn't seem to be quitting. And the gearwheel in the ...
0
votes
0answers
8 views

iMac 18,3 Mac Mail Adding Reply-To:

I would have a different Reply To: for each email account. I could be activated by clicking the send button in Mac Mail or the reply button.
1
vote
2answers
19 views

How to make applescript type items into url bar

How do i make applescript type certain things such as urls into the url bar? I've been trying to set up my computers so I don't take 9 years to set everything up when I need to work. I have most of it ...
0
votes
0answers
13 views

How to switch Google Chrome profile using AppleScript [on hold]

I want to switch Google Chrome profile using AppleScript. Is it possible to do so?
9
votes
0answers
29 views

Open and focus file browsing dialog from command line

I'd like to open the native file browsing dialog from the command line, focus the dialog, and then get the full path of the selected file. The following works nicely, but the dialog is not focused ...
3
votes
0answers
28 views

AppleScript to toggle dark mode with fading

I have a script to toggle dark mode using tell application "System Events" tell appearance preferences set dark mode to not dark mode end tell end tell However, this causes every ...
1
vote
0answers
52 views

Edit TCC.db to bypass “'Foo.app' wants access to control 'Bar.app'” on own machine

I make extensive use of Apple Events to control a wide variety of applications on my machine. The new security prompts introduced in Mojave are crippling. In previous versions of macOS, once an app ...
1
vote
1answer
26 views

How can I change the picture used by this AppleScript?

I am using this: osascript -e 'tell application "Finder" to set desktop picture to POSIX file "/Library/Desktop Pictures/Earth Horizon.jpg"' to set the desktop on a lab of computers. How can I ...
0
votes
0answers
14 views

AppleScript to check whether current Apple Music track is in library

There doesn't appear to be a property for tracks in iTunes to check whether the current track has already been added to the library. If I'm listening to somebody else's playlists, I want a script to ...
1
vote
2answers
28 views

document.querySelector with AppleScript / Safari

I need a script to open each tab in safari when I get "valueIneed" from an internal website here is the HTML tag <td class="orderDetails"> <p class="details"> (My ...
1
vote
0answers
15 views

How to open multiple iTerm2 tab with admin privilege

So I have an executable program in my /usr/local/bin/ called myApp. I need to run multiple myApp processes in new iTerm2 tabs with sudo. The file structure is like this: --myFolder ----v1 ----v2 ---...
1
vote
0answers
33 views

Has Mojave broken Applescript: set volume output volume?

set volume output volume 25 I've used that simple code for well over a decade to set my Mac's audio to a specific volume (25, on a scale of 0-100), but since upgrading to Mojave, running it causes no ...
3
votes
0answers
43 views
+50

Apple script fail on copying attachment from Outlook

I'm trying to copy all the attachments that I received from a certain sender (scanner) to a folder. I'm using Outlook and I've tried to write a script to do the job. It fails on saving the file with ...
3
votes
2answers
56 views

How to force quit Applescript app from terminal?

I wrote an applescript that turns on my lights. I exported it as an application with the name "LightsOn", and it appears with that name in activity monitor. Under certain circumstances, this app gets ...
1
vote
1answer
51 views

How do I copy multiple files to macOS's clipboard programmatically?

I ultimately want to have a bash function to-clipboard which gets file paths and copies the files to the clipboard. Using other scripting languages as helpers is okay. I currently have this for ...
2
votes
1answer
41 views

How to pass two variables from previous actions to “run applescript” in Automator

What I'm trying to is: Receive a string from "Ask for Text". Get a file from Finder. Do some codings these inputs in Applescript. Seems like Applescript only receives file as input, I have no idea ...
4
votes
1answer
48 views

List of all AppleScript commands for Terminal application

In AppleScript we can write things like: tell application "Terminal" activate set currentTab to do script (someScript) end tell I mean we are using commands like activate and set currentTab.....
3
votes
1answer
45 views

How can I install this script as a folder action?

I'm trying to setup a script as a folder action that will identify and change unwanted characters in the name of a file added to a target folder. The intent is to have this automation run as a ...
-1
votes
1answer
36 views

Copy from excel to URL

I'm doing my first applescript. I want to copy a short text (that's a website) from excel into the Pingdom Tools Speed Test. In the long run I want it to do it with a lot of different texts - but ...
-1
votes
0answers
32 views

Automator or applescript search and copy

I am looking to copy pdfs from an external drive. I need to copy only the main pdf from a specific folder called "final". Inside "Final" there is a "DATE" folder which changes then I want to copy the ...
0
votes
0answers
31 views

Applescript - bookmark all tabs in ALL WINDOWS in Safari

Safari, have the Bookmark all tabs, function in the menu Bookmarks -> Add Bookmarks for these N tabs. I looking for a way how to do this automatically with applescript in all opened Safari windows. ...
0
votes
1answer
81 views

Address Book / Contacts.app AppleScript plugins no longer working in Mojave

For years, I've relied on an AppleScript (.scpt) file placed in ~/Library/Application Scripts/com.apple.AddressBook to provide click-to-dial functionality via our Asterisk PBX directly from macOS ...
1
vote
1answer
38 views

Applescript to return name of new file added to folder

This is mostly a test so that I can work up to the function that I want to create down the line. I'm very new to AppleScript so bear with me! I wrote this as an attempt to test a folder action that ...
2
votes
1answer
27 views

How can I use a keyboard shortcut to run two or more keyboard shortcuts

I'm using Due app on the mac, and I'm wondering if it's possible to have one keyboard shortcut to run the app, reset the running timer ( command+ shift+ s) and then run the timer again (command + S) ...
1
vote
0answers
35 views

How do I find the actual command that was used to run an AppleScript script?

From https://stackoverflow.com/questions/5770384/how-find-the-file-name-of-an-executing-applescript I know that you can use the path to me as text in order to get the absolute path name of the ...
0
votes
0answers
18 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
1answer
33 views

AppleScript - Get every desktop including hidden Mission Control desktops

I'm trying to write a simple script that will change my desktop background on all of my desktops/workspaces at once. Right now I have this: tell application "System Events" tell every desktop ...
0
votes
0answers
12 views

AppleScript - filter selection

I'm using AppleScript with BareBones Software's Yojimbo. I'm trying to filter a selection. This works: tell application "Yojimbo" to set theYojimboSelection to selection but this does not: tell ...
3
votes
1answer
54 views

In AppleScript or JavaScript how can you click menu item?

I need to change a theme using a script for Mojave, Alfred and Sourcetree. I've already successfully done this with Mojave and Alfred using this script: var alfredLightTheme = "Alfred" var ...
2
votes
2answers
76 views

Automator: Service to move files into new subfolders based on file extension *within any selected folder*

I've been searching for quite a while now but can't seem to find relevant instruction for this particular task. I'm brand new at this so apologies if I'm missing something basic. Like many ...
1
vote
0answers
25 views

Keyboard shortcut or AppleScript to move current tab into a new window

Recent versions of macOS bring tabs to applications that didn’t seem to support tabs before (e.g. Anki flashcards), via the Dock preference to always prefer opening things in tabs. Stock apps and ...
0
votes
0answers
49 views

Keyboard shortcut to show Tags… dialog

In the Finder, you can select a file and choose Tags... from the File menu or contextual menu. It will show a little dialog that allows you to select or type tag names, and you can press Enter to ...
3
votes
1answer
40 views

Using AppleScript to delete select files in a folder?

I have duplicate photos in a folder. (Thousands of them.) Their names are all Xxxxx (1).jpg. I'd like to automate their deletion but haven't hit on the correct syntax. I've been trying variants on the ...
2
votes
2answers
47 views

How to detect network change (unplugging/plugging cable)?

I have read at multiple places that the folder /Library/Preferences/SystemConfiguration is supposed to "change" in case that I unplug a network cable. Now, I have a MacBook Pro, so I use a USB3 ...
0
votes
0answers
16 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:...
-1
votes
2answers
63 views

Custom dialog box in Automator?

I would like to create a service that performs a set of actions based on several parameters A custom dialog box with multiple radio buttons would be a great way to capture these. My experience with ...
0
votes
0answers
30 views

AppleScript get value of a button

I want to get the value of a button from an internal tool. tell application "System Events" to tell process "App" set myNumberIs to get value of radio group 1 of group 1 of splitter group 1 ¬ ...
1
vote
1answer
44 views

AppleScript How to return first n elements of item in list

I have never written anything in AppleScript but I recently got a MBP and started playing around with it just to tweak the touchbar. In a downloaded preset I saw this line: set theArray to every text ...
0
votes
0answers
22 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 ...
3
votes
2answers
76 views

What is the correct application to call to be able to use date?

In AppleScript if you have a string with a date and try to convert it to a class of date it will error out in Finder and System Events. Example: set testDate to "Friday, September 21, 2018 at 6:54:...
1
vote
1answer
55 views

macOS: How to open a local HTML file with URL parameters

I want to start a Kantu web macro from the command line on Mac. Essentially this is as simple as opening the Chrome or Firefox browser with a local HTML page (which contains the macro code). All works ...
0
votes
1answer
33 views

Display an overlay while a hotkey is pressed

I have recently switched to a keyboard with a particular layout, and I'd like to setup a system-wide keyboard shortcut to display an image overlay on the screen while pressed. This image would be a ...
1
vote
3answers
311 views

How do I get an AppleScript application to automatically run at login?

The script I have helps with my computers ability to edit videos. I only use my computer for editing. The script just activates a program that I have made. I want to be able open my computer after it ...
3
votes
2answers
84 views

Open a note or display dialog with application

I work with a colleague editing videos and I wish to trigger a dialog or a note document whenever he opens Final Cut, so I can leave messages for him to do the job. The machine has to stay always on, ...
2
votes
0answers
21 views

To move Mac App to a second screen when it launches at the main screen/space initially?

I hope to use a apple script to move the Microsoft Remote Desktop App (MacOS version) to a second screen, center it(, and click a remote config) when it's been lunched and shown in the main screen ...
0
votes
0answers
26 views

AppleScript to open .gsheet file or convert

I have a folder on my desktop that syncs with my google drive which contains .gsheet file extension. When clicked it opens safari and that specific google sheet . I’m trying to figure out if these ...
1
vote
2answers
87 views

Need script or app to convert filenames and folder names from day/month/year order to year/month/day

I have recently been sent a large number of tif files where for some misguided reason the file names have all been recorded in DD/MM/YY format ie 130307 whereas I need it as YYYY MM DD. The files are ...
2
votes
1answer
33 views

Applescript/Javascript to click submenu item of Jupiter Notebook in Safari

When I run a.ipynb jupyter notebook file in Safari, it opens at local host http://localhost:8888/notebooks/a.ipynb#. NOTE: The script should work for any *.ipynb file, a.ipynb is just an example. ...
2
votes
1answer
52 views

Any way to open a URL in a script without having it open in a browser

The situation: My mobile carrier offers for free to send SMS notifications by following a URL. What I'd want: Include these URLs in various scripts to get notifications when I'm away from keyboard. ...
0
votes
0answers
15 views

What kind of link is this to parse in AppleScript

("http://www.sportsline.com/nfl/odds/", "//div[@class='row-group']") Is this an XML or HTML. I want to parse it in an AppleScript to numbers and I wanted to get a base of what it is? Thanks