Questions tagged [applescript]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
76 views

Get AppleScript's “do shell script” to use the latest Bash

For some reason, I cannot get AppleScript's "do shell script" to use the latest (GPLv3) Bash: do shell script "/usr/local/bin/bash; echo $BASH_VERSION" -- Result: "3.2.57(1)-release" Strangely, it ...
1
vote
1answer
230 views

Use Apple Script to open Chrome with specific profile

I use multiple instances of the Chrome browser for different profiles, each with their own google account. I'm trying to automate a task using Applescript and Automator, and have set up Automator to ...
-1
votes
1answer
377 views

AppleScript: start/stop QuickTime Player screen recording on timer

I would like to use an AppleScript which will tell QuickTime Player to start screen recording immediately and stop screen recording after a specified length of time (e.g. 60 mins). In my search so ...
0
votes
0answers
24 views

How can I set what computer uses the secondary monitor with a script?

I have two computers, an iMac 27" and a MacBook Pro, both running Mojave and a Thunderbolt 27" display. Both computers are linked to the external monitor through a thunderbolt cable. I primarily use ...
0
votes
1answer
41 views

How can I write a script that opens a notification?

Is there an apple script that can click on the notification for me so that I don't have to open the app using a mouse? I plan to bind this script to a keyboard shortcut and that way I can open ...
0
votes
0answers
21 views

Why doesn't my screen turn off with this automator service?

I have created an automator task to run a screen to turn my screens off, using the keyboard shortcuts section in the System Preferences I able to map this to a keyboard shortcut. My automator script ...
0
votes
0answers
14 views

trying to move emails not addressed to me to subfolder using AppleScript in Outlook

I have all these emails that are not directly addressed to me but to groups I am a part of. They're annoying and means I find it difficult to notice emails actually addressed to me. I have tried the ...
0
votes
3answers
57 views

Script iTunes to prepend Season and Episode number (padded) to episode title

I'm not knowledgeable about scripting, so I'll be upfront about that. I've been doing management with Doug's Scripts for over a decade, but the one that would be most useful (Append to Selected Tag) ...
0
votes
1answer
40 views

Automator service works everywhere except when using keyboard shortcut

My automator service is as follows: Workflow receives no input in Google Chrome.app Input is entire selection (checkbox not checked) Run Applescript on run {input, parameters} tell ...
0
votes
0answers
46 views

Automator or Apple Script to compress 3 folders?

I have 3 folders I want to compress to an archive and put that archive in a specific location. I'm running in to a few different issues depending on how I tackle the problem. All 3 files live in ~/...
0
votes
0answers
17 views

Automator Application: Retrieve --args passed by “open”

I am trying to create a simple application using the Automator that is supposed to open a given file in vim in a new iTerm window or tab (if a window already exists). So far the application consists ...
0
votes
0answers
37 views

“Grant File Access” dialog in Word 2016+AppleScript when inserting a picture

Please Help!! I have been using FMP to insert images into a word document by using apple script. This has been working fine until today (recent word update occurred and the likely culprit). When the ...
1
vote
0answers
14 views

How do I use AppleScript to click buttons on a website? [duplicate]

I am looking for a way to use AppleScript to test my website. Is there a way that I can make AppleScript click on different buttons and click on Text Input Fields using the JavaScript ID? I am aware ...
1
vote
4answers
130 views

Automator keeps using numbers in exponential form

I created this code that should launch whatsapp with a specific number in clipboard: on run {input, parameters} set text1 to the clipboard set text2 to 1 - text1 as real do shell ...
2
votes
0answers
87 views

Automator workflow to screen capture a series of video links

My job requires me to screen capture recordings in Adobe Connect, using Camtasia. I would love to set up a list of urls for many of these recordings and have Automator cruise through them while I'm ...
0
votes
3answers
50 views

How do I quit multiple versions of Firefox with Apple Script?

I have two versions of firefox. One has an application name "Firefox" and the other is called "Firefox 2". I'd like to tell AppleScript to close both instances of Firefox. Here's my code tell ...
0
votes
0answers
88 views

Applescript - how to control multiple instances of the same application

I have 2 instances of the same application (e.g. Firefox, Chrome, Spotify, etc) and I'm trying to control one specific instance by PID or other methods via Applescript and the app specific methods. E....
0
votes
1answer
43 views

Run script through launch agent is failed

I try to run the next script through LaunchAgent: on run argv set current_path to POSIX path of ((path to me as text) & "::") set common to load script (current_path & "common.scpt") ...
2
votes
0answers
44 views

System-wide Google Search shortcut for Chrome (macOS version)

on the macOS, does anyone know how to set up a system-wide global keyboard shortcut to Google Search the selected text within the Chrome browser? (this could be easily done for Safari but not sure how ...
-1
votes
2answers
57 views

How do I add a custom app icon for AppleScript app?

I have my own AppleScript app. How would I add a custom App icon to it? EDIT: The only solution that has worked for me is pasting the image into the existing icon in Finder.
0
votes
1answer
62 views

How do I hide Terminal windows using AppleScript?

I am using an AppleScript where I need to open many Terminal Windows using: repeat while counter > windowAmount tell application Terminal do script "" end tell end repeat Is there ...
0
votes
1answer
25 views

apple numbers Filling data into a table using AppleScript

I have a document on numbers with 3 sheets. 1-data entry table (based on the "data" sheet). 2-copy dada table with: -- I.an additional column containing the following formula if(reference ...
0
votes
4answers
80 views

Opening Randomized Images From Multiple Folders With Preview Application

Basically what I am trying to achieve is the following: Create an alias list of any amount of folders with the Finder's selection. Get all images from those folders with a shell script. Randomize ...
0
votes
0answers
12 views

Trying to tell ITunes to play the highlighted artist using Applescript

To elaborate I'm trying to simulate me pressing enter on this situation: To play the songs of the highlighted artist, but in a non-focused iTunes (so while I'm on another app). I tried telling iTunes ...
0
votes
2answers
77 views

How to save the sudo password in AppleScript?

I need to use tell Terminal ... to do ... sudo ping ... and I need it to repeat in many windows. It asks for the sudo password every time. Is there any way I can ask the user for the password and then ...
0
votes
0answers
42 views

How do I ask the user for an integer in AppleScript?

I would like to ask the user for an integer input using AppleScript but I am unable to find how to do that. When I use set userInput to display dialogue "Please enter a number." default answer "" with ...
1
vote
4answers
271 views

Applescript, how to mount remote server without error if unavailable?

I attempted this question earlier today but finally realized I had completely mangled what I was trying to ask and also posted the wrong script code. This is attempt #2. I have two Macs that reboot ...
1
vote
3answers
59 views

Applescript exits return loop before complete

I have to go through a stack of hard drives & usb keys looking for old quickbook files. So, I've written an applescript which triggers when a new drive is mounted. It then searches the drive for ...
0
votes
0answers
85 views

How can I use AppleScript to set Night Shift?

I have setup an AppleScript that tries to change the state of Night Shift: https://gist.github.com/HanSooloo/0c1223e9efecf26d3110fc1f22913cff PROBLEM STATEMENT: However, I am getting an "Invalid ...
0
votes
1answer
44 views

Force-disconnect all remote users from Applescript or shell?

I have a mac that I want to automatically restart every night, but it is regularly accessed remotely from other machines in the house, and if anyone is still connected when it needs to restart it ...
0
votes
0answers
54 views

How to insert image into Numbers with AppleScript

I'm trying to create an AppleScript that will: find the value of cell "x" tell application "Numbers" to ¬ tell table 1 of sheet 1 of document 1 set theimagename to value of cell "A8" ...
0
votes
0answers
13 views

Use osascript to send a “global shortcut”

I am using this wonderful application named NoiseBuddy which allows to turn on/off Airpod Pros noise cancelling with a global shortcut. In my case I assigned the shortcut to ctrl+1 and it works fine. ...
0
votes
1answer
56 views

AppleScript to Rename file list to Specific Names

I've spent hours researching this and I can't seem to find an answer, so your help would be greatly appreciated! I have an audio recorder that outputs 16 files that are always named the same. ...
0
votes
1answer
100 views

How to use Launchd? [duplicate]

(sorry if this is a bad question. I am new to apple coding) I want to run a .scpt file at a specific time, once a day, every day using launchd (if there is a better way please tell me) I am running ...
4
votes
2answers
88 views

AppleScript app is not recognized as default browser

Target OS: Macos 10.15.3 Catalina Goal: use apple script bundled to app as a default web browser To debug I'm using very simple apple script, that just show passed url in dialog on open location ...
0
votes
0answers
38 views

macOS Screen Saver From The Finder's Selection Via Applescript

I will like to be able to set and start the macOS screensaver via the Finder's selection using Applescript. I will also like to be able to choose which screen saver pattern will be displayed. For ...
2
votes
2answers
55 views

Applescript app keeps crashing

Whenever I try running this code it does not log the text. repeat set myTime to (time of (current date)) set precisetime1 to 82800 set precisetime2 to 84600 set ...
0
votes
2answers
168 views

Can I handle the Apple Event “open” within a bash shell script using osascript command?

I use a bash script (myJavaBash.sh) within an Application Bundle (myJavaJar.app), that starts "java -jar myJarFile.jar" with additional JVM arguments (which works fine so far). My goal is to pass a ...
1
vote
0answers
38 views

Applescript to chop specific text out of a text file and paste it to notes file

I have created a text file from a pdf using automator. I am now trying to copy two separate slices of this file and paste them to a Notes file. Here is a sample file: A lot of text above...............
0
votes
1answer
170 views

Setting to open new TextEdit document window in center?

I use TextEdit regularly as a scratchpad and to open script outputs. Annoyingly, TextEdit insists on opening a new document window in the top left corner of the screen. Is there any setting I can ...
0
votes
1answer
151 views

Automator: Take screenshot > Prompt rename > Add date and time to name

This is what I need to achieve: I take a screenshot Automator watches my Screenshot folder for a new file A prompt appears for me to rename the file Date & Time are added after the name I give it ...
0
votes
1answer
56 views

Click handler in Apple Script

I created a standalone macOS app using Script Editor. Upon starting, the app executes a bash script and upon quitting, the app executes another bash script. The code looks like this do shell script "...
-1
votes
1answer
35 views

osascript button position in dialog box

Wanting a larger space between Yes and No buttons within the dialog box osascript -e 'display dialog "Choose a button ..." buttons {"Yes", "No"} default button "No" giving up after 5' This ...
3
votes
1answer
35 views

Use AppleScript to find the currently playing song (and other metadata)

The audio section of the touch bar can automatically detect which app is playing audio, and adds media controls to play/pause, skip, and seek through any audio. As an example, this works for Quicktime,...
0
votes
0answers
23 views

Include an image and format text in the content of a Microsoft Outlook email generated using Applescript

I am using Applescript to automate an email and would like to include an image in the content of the email (not as an attachment, needs to be in the content). I would also like to format the text (...
0
votes
1answer
188 views

AppleScript error: “Finder got an error: Network file permission error.”

I have an automator script that I use to create an empty file in finder and I've been using it with no problem for about a year. All of a sudden, it's giving me this error: The action “Run ...
-1
votes
2answers
68 views

I made an AppleScript app and Siri won't launch it

I followed iFixit tutorial how to make "AirPods connect" app for Mac. It works perfectly but I cannot run it with Siri. Using Spotlight or clicking on it works, but Siri won't open it and says "I'm ...
1
vote
1answer
46 views

Login user - opposite to launchctl bootout user/id

How can I login user in programmatically way? I need something opposite to command launchctl bootout user/502 that logouts user with id=502. Does this way exist?
1
vote
1answer
173 views

Need help setting up a script to change date and time Mac OS Catalina

hoping someone can help with this. I am trying to write an automator terminal script in Mac OS Catalina that will turn off WiFi, turn off automatic date and time settings, and set my mac to a specific ...
0
votes
2answers
111 views

Manually enter “Where From” text for screenshot Metadata?

What I would love to be able to do, is the opposite of what this person asked about; I want to ADD the "where from" text (in my case, a URL I could copy-paste from a browser tab) for screenshots I ...

1 2
3
4 5
55