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
1answer
14 views

How to make Automator service that enters highlighted text into Chrome address bar?

I'm trying to make an Automator Quick Action that will show up in the right click menu under Services that will take the highlighted text and put it in a new tab in Chrome. Looking at various other ...
1
vote
1answer
32 views

How to use Applescript to open a printer app and select items within?

I have absolutely no knowledge or experience in using Applescript or Automator. I'm hoping by using either to create an app (or script) that will print a test page off my printer automatically. I know ...
0
votes
0answers
13 views

Mail.app - compare two mailboxes?

I try to transfer 50 000 mails from an IMAP account A to another IMAP account B using Mail.app but it constantly fails during the process (that takes a day or so). There is a message-id-based ...
0
votes
1answer
17 views

AppleScript : do JS on different Safari windows

I'm using some script which basically get text from safari, click button and fill up textfield. e.g : tell application "Safari" set texttograb to do JavaScript "document.getElementsByClassName('...
2
votes
1answer
303 views

NSString doesn’t understand the “stringWithString_” message

I'm creating an AppleScript Script Library, and want to call some Cocoa methods on NSString. I created an .SCPTD file with this method: on xtrim(sourceText) set the sourceString to current ...
0
votes
1answer
20 views

Catalina: How to add System Events to System Preferences > Security & Privacy > Privacy > Automation?

The problem In a script I'm using AppleScript to reload the browser when a change happens. I start this in the builtin terminal of my IDE, WebStorm. Since MacOS Catalina this yields the following ...
0
votes
1answer
22 views

Clear recent file list in AppleScript?

I created an AppleScript for cleaning the clipboard which had this command: tell application "System Events" to set the clipboard to "" How would I create an AppleScript that did ...
17
votes
5answers
34k views

Turn Wifi off/on with a single key?

Is there a way to assign the WiFi on/off function to one of the function keys like F4 that I otherwise never use? I assume Applescript would be required. However I may want to use a BASH script ...
-1
votes
0answers
22 views

input expect to open website variable [closed]

When I type in my s answer then the s answer has to open the website (s needs to be the website) set s to display dialog "Type in witch website you would like to go to" default answer "...
0
votes
1answer
22 views

Input validation, expect error on null input

I expect the code to display an error and then ask the question again when the user enters no text set tname to "" repeat while tname is equal to "" set tname to text returned ...
1
vote
1answer
25 views

How make BBEdit Color Scheme follow system dark mode setting

BBEdit has an awesome setting to make the application appearance match the selected editor color scheme – so when selected, if you select a dark color scheme in Preferences, it puts the app's chrome ...
0
votes
0answers
37 views

How to use voice recognition with Apple Script

can someone help. tell application "SpeechRecognitionServer" set theResponse to listen for {"open (said application)", "who are you"} with prompt "Hello... I am ...
1
vote
3answers
239 views

How to clear all notifications with 1 click in Catalina?

This question offers an AppleScript to clear all notifications within the Notification Center, but all of the answers seem to be pre-Catalina: How do I clear All OS X notifications with 1 click? ...
0
votes
1answer
152 views

How do I trim first and last few seconds of a mp4 using AppleScript?

I'm using Mac 10.13.3. I want to trim the first second and the last two seconds from my mp4 (movie). I tried writing an Applescript like so trim output.mp4 1 from (0*60 + 1) to (32*60 +38) but ...
1
vote
2answers
42 views

I set my startup disk to Macintosh HD. But after opening it, the name becomes “/”

Using the System Preference -> Startup Disk I set my startup disk to Macintosh HD. When I open it the name at the top of its window is "/". When I open the startup disk using Applescript ...
3
votes
2answers
5k views

AppleScript: How to extract section from string (based on defined characters)?

Example: set theText to "I ate an apple at 11:54 pm without the skin." I would like theTime to be a string that contains the text: 11:54 So, I would like the opening text item delimiter to be at_ ...
1
vote
1answer
34 views

Get text of most recent notification with applescript

I would like to be able to grab the text of the most recent notification and pass it into an applescript variable. How can I do that? Edit: here's what I have so far: on run tell application "...
0
votes
0answers
30 views

com.automator.runner.xpc is not allowed to send keystrokes

I have two MacBooks. Both run the same MacOS version. I installed the same Automator script in both. But on the older MacBook I get: The action “Run AppleScript” encountered an error: “System Events ...
0
votes
0answers
11 views

Batch command to lock multiple files using Box Drive

My company uses Box.com and Box Drive to host collaborative files. Box gives the ability to lock files so multiple people can't work on them at the same time. With Box Drive I can right click ...
3
votes
1answer
44 views

Is it possible to add background music (with or without video) to the login screen on a Mac?

I've never seen this question asked before, and provided that Terminal exists I don't see why this wouldn't be possible. Does anyone know whether this is, or how they would make this possible?
5
votes
4answers
3k views

Why does this applescript not actually set the input volume to zero?

I have this command that builds a script to mute the input volume. The input volume is not fully muted, though. It seems to be closer to 10% than 0%. osacompile -x -e 'tell application "System Events"...
0
votes
1answer
26 views

Using Applescript to append user input to existing note in Notes App

I've been using this little utility to save out random thoughts through the day to a text file. I want to append the user input to an existing note in the notes APP, but can't figure out getting ...
-1
votes
0answers
24 views

Applescript to Save CSV attachments to folder then merge them to a master CSV file

I'm getting compilation error with this. Could you look it over and give some insight please? on perform_mail_action(ruleData) -- The folder to save the attachments in (must already exist) ...
0
votes
1answer
39 views

Portable UI Applescript for choosing any menu item through any hierarchy of sub-menus

At the bottom of this page Apple explains how to use UI scripting to automate selecting menu items. There are two hardcoded examples that I'm drawing on in an effort to write a generic library script ...
0
votes
0answers
12 views

Can I trigger an Apple Script event before my Google Calendar event ends?

I'd like to receive a notification whenever a meeting is within ten minutes of ending. I use Google Calendar, but I'm open to syncing my Google Calendar to Mac Calendar. Can I set a Growl ...
0
votes
1answer
24 views

How to stop speech in automator action

I can make an Applescript within automator so it reads text at N speed: on run {input, parameters} repeat with thisText in input say thisText speaking rate 400 end repeat end run However, ...
4
votes
3answers
122 views

Open a new MacVim window with AppleScript

I can open a new iTerm window like this: tell application "iTerm" create window with default profile end tell How do I do the same but with MacVim?
0
votes
0answers
34 views

Use Google speech to text instead of Apple's

Google currently has much higher quality speech transcription. You can try it easily by going to doc.new and pressing Cmd-Shift-S and talking. Compare to using the built in system from Apple (pressing ...
-1
votes
0answers
31 views

Find the Tag Position of specified text on webpage

Can someone please point me in the right direction for this please? I am trying to copy text from a webpage using AppleScript. The code below finds the word "COMMENTS" in Tag position 112. do ...
1
vote
1answer
38 views

Automator Help: take Fixed-Position Screenshot, click “Next Page” and Repeat (that's it!)

I don't know code which is really embarrassing for simple tasks like this one. All I'm trying to do is to make a Quick Action in Automator for this: take a screenshot based on two fixed points click ...
0
votes
1answer
22 views

start outlook and open calendar using applescript

I know how to start outlook: tell application "Microsoft Outlook" activate set folderName to "Calendar" end tell but the set folderName does not seem to open the calendar view
0
votes
1answer
24 views

How to move/hover mouse (not click) over a button on Safari by using Applescript

Can anybody tell me how to write an Applescript that can move or hover mouse over a Button on Safari? I've successfully made an Applescript that can click to the button but I don't know how to make ...
0
votes
0answers
11 views

How to get contents of most recent iMessage

I would like to get the contents of my most recent iMessage using either applescript of terminal. I'm fine with it going to the clipboard or a variable, but I can't find this information anywhere. ...
0
votes
1answer
76 views

Allow ssh-keygen-wrapper to access “System Events” for all users in the same computer

When I run my AppleScript in a remote mode, I get this message in an user where the script runs: “sshd-keygen-wrapper“ wants access to control “System Events“. Allowing control will provide access to ...
0
votes
1answer
112 views

How to make an AppleScript to automatically translate emails from a foreign language and redirect them to yourself?

I receive many emails in Japanese everyday (I am living in Japan). Some are spam but some are important. I would like to have an AppleScript to do the following Translate the email (with google ...
0
votes
0answers
18 views

Automating sorting process for files in a folder based on same prefixes in their filenames

Okay, I have a directory that is the output directory for generated screenshots for a media player I use on a macbook (OS X High Sierra). I take a multitude of screenshots to review video files and I ...
2
votes
1answer
635 views

Detect when an application goes fullscreen?

I would like to detect that event from an Applescript. I have found the lsappinfo command-line app, which has a listen command that seems to fill my need exactly, but going fullscreen does show up in ...
1
vote
1answer
25 views

Issues with AppleScript scripting Mail

I'm having some problems. Googling them I found this: https://discussions.apple.com/thread/8022877 I'm having almost identical problems. tell application "Mail" to make new account ... ......
0
votes
1answer
40 views

I want to create a script in script editor that will press a key and then press enter every 60 seconds

I want to create a script in script editor that will press a key and then press enter every 60 seconds. However, I don't know how to make a script that presses a key. Does anybody know how to make a ...
-1
votes
2answers
1k views

Creating an account and sending mail using applescript

I'm trying to use applescript to do two things: Create an account in Mail.app Using that account, send an email in Mail.app I'm having an issue with creating an account on Mail.app mainly because ...
1
vote
1answer
179 views

Applescript to set terminal window to specific size

I found this question Is it possible to define the width/height of a Terminal window with this command: osascript -e \'tell application "Terminal" to do script and tried setting my ...
0
votes
0answers
13 views

Run an AppleScript remotely from another Mac or iOS device

I have an AppleScript on my Mac (which controls VLC and Airfoil to play internet radio through some Airplay devices) and I want to be able to run the script by doing a simple action, i.e. one or two ...
0
votes
1answer
219 views

AppleScript saving global variable

I'd like to access the variables origTrack and origPlaylist from another AppleScript so that I can return to the track and playlist that were playing before the first script executed. Here's what I ...
0
votes
1answer
15 views

Applescript voice control

I'm trying to create an app to toggle voice control on and off, as for some reason Catalina removed the link between dictation and voice control thus ridding itself of the ability to use a keyboard ...
1
vote
1answer
38 views

Selecting multiple words via AppleScript in PowerPoint

I'm trying to come up with an AppleScript that selects multiple adjacent words in a Microsoft PowerPoint slide. I figured out how to select single words, and how to select the entire range of a text ...
0
votes
2answers
41 views

Using automator and AppleScript to move a file to a different folder and subfolder based on name and content of a file

I'm a total newbie on Automator and Scripting... I have read a lot of answers to problems a bit similar to mine, but I don't succeed to adapt with Automator + AppleScript. Here is what I want to do: ...
0
votes
0answers
34 views

Using appleScript for remote auto login to macOS

I'd like to be able to log in my computer through Apple Remote Desktop (SSH) by running a script while the remote computer is running the loginWindow. An ideal script would automate the process of ...
0
votes
0answers
24 views

Applescript on Catalina

Total scripting novice here, appreciate any insight. Have a few scripts that automate button presses in a specific application, triggered by Function keys. Worked well before Catalina, now when ...
0
votes
1answer
75 views

Automator “Quit Application” Action stops

I'm trying to set up an Automator script to do a bunch of routine things before I pull my laptop off it's thunderbolt dock - turn WiFi back on, eject disks, and quit certain applications. It's this ...
1
vote
3answers
67 views

How to open a fixed URL + what's in the clipboard via a script & bind it to a shortcut?

Will this applescript work? Tell Application "Safari" to open location "http://www.site.com/" end tell Tell Process "Safari" Keystroke "l" using command down Tell application "System Events" to ...

1
2 3 4 5
54