Questions tagged [applescript]

AppleScript is the Mac OS scripting language.

Filter by
Sorted by
Tagged with
0
votes
1answer
20 views

Automator/Terminal/Apple Script: Fetch data from macos console app

I want to use automator or terminal to fetch data from the mac console app. In particular: If you search for "sleepwake" in the console app › tab "Mac Analytics Data", you get the ...
-1
votes
2answers
36 views

How to use AppleScript to run any app as root?

I write some AppleScript to run "Turbo Boost Switcher" as admin and save it as appication so i can launch it with root access without typing password. also add my moded script it into login ...
0
votes
0answers
15 views

How can I tell itunes to default to playing music on my computer?

I have an apple script that plays music and it often stalls out due to this error. Can I tell iTunes to automatically select the computer when my headphones are unavailable?
0
votes
0answers
3 views

How do I run apple script on a particular instance of Firefox? [migrated]

I have three instances of Firefox called - Firefox Firefox 2 Firefox 3 They all live in the Applications folder and the difference is that they have different Firefox profiles and cookies. I'd like ...
0
votes
0answers
17 views

How do I switch spaces without using `keystroke` with Apple Script?

I'd like to run an apple script that follows these steps- Make a web browser full screen Open another application which disables my keyboard Return to the web browser When I make the web browser ...
0
votes
1answer
14 views

Can I de-activate my keyboard with apple script?

I'd like to run an apple script that will temporarily disable my keyboard from registering keystrokes. My goal is to make it so that my computer is logged in, but unable to type anything. I'm ...
0
votes
0answers
40 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
36 views

AppleScript to enable/disable something during Remote Desktop usage - SOLVED

I've tried to make this script/app work myself, but can't figure it out. Basically, I am trying to enable/disable the functionality of SensibleSideButtons (SSB) based on whether or not I am actively ...
0
votes
0answers
8 views

OS X start/stop 3rd party preference pane using applescript

I use Hazel (a third party preference pane) but have a need to be able to Start/Stop using an applescript or terminal command (saved as applescript) embedded as an action in a third party macro. ...
0
votes
1answer
37 views

I accidentally corrupted a plist file belonging to the speech synthesis server, how do I fix it?

I was trying to write an AppleScript that would recognize the language of a selected text, and then set the speech synthesis voice accordingly and then let my Mac speak the text out loud. This is how ...
0
votes
1answer
369 views

Hotkey to change Mic volume on Mac OS X?

I'm wondering if there is a way – perhaps via Applescript – to assign a keyboard shortcut to raise the volume of the microphone by 10 e.g., and then the other way: another keyboard shortcut to lower ...
0
votes
0answers
18 views

How to Clear VLC Playlist with Apple Scripts

By default, VLC will keep the songs that were played in the last session as part of the playlist. I have an AppleScript that plays music that is stored as MP3 files in a folder. tell application "VLC"...
1
vote
2answers
109 views

Applescript won't move onto next instruction without ending shellscript?

I'm a new user to Applescript and programming in general. I'm trying to create a script that will 1) load a Renpy project through the terminal and 2) then move the resulting project window to a ...
-1
votes
1answer
12 views

How to create system notifications for Macbook Prof / MacOS

For Ubuntu it's easy to create a desktop notification: https://askubuntu.com/questions/187022/how-can-i-send-a-custom-desktop-notification it looks like: $ notify-send "Hello world!" on MacOS, I am ...
0
votes
0answers
12 views

Run script after all items in Login Items are opened

I want to run an AppleScript when macOS is done with opening my Login Items. Is it possible to listen for a signal from macOS when it's done with that?
0
votes
0answers
72 views

Need help working with automator applescripts in Numbers on MacOS catalina

I am working with numbers sheet and I want to create a keyboard shortcut so that when I press a button the script searches for the number "1" in column I, when it finds the number "1" it will increase ...
1
vote
2answers
384 views

How do I target and close a specific Terminal window in AppleScript?

Background Given the below terminal script, I want to modify the osascript so that instead of targeting the front window I am targeting the specific window that is opened from the AppleScript. ...
2
votes
2answers
216 views

How to get the pid of a opened Terminal window in MacOS?

Background I want to obtain the pid of a specific Terminal window. ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}' However, the above grabs the pid of the entire application and not ...
0
votes
1answer
83 views

How to close a Terminal window using bash and AppleScript without using SystemEvents?

Background I am trying to create a script that when executed, opens a new Terminal.app window executes the desired commands and closes the window when complete. One solution was to use SystemEvents ...
0
votes
1answer
58 views

toggle iCloud preferences from terminal or applescript

I'm looking for a script to toggle iCloud preferences in system preferences. I need to automatically uncheck all the voices (Photos, Mail, Contacts, etc) leaving only iCloud Drive and Find My Mac. ...
0
votes
0answers
21 views

How do you modify OS X Automator's prebuilt actions?

I am trying to use the actions that are pre-built for automator in Mac OS X (Mojave, for me), but modify them slightly. For example, the "rotate images" action - I would like to have the option of ...
0
votes
1answer
145 views

Applescript: How to open a random file from a specified volume? (.dmg location)

Ok so if I want to open a random file from a folder on my Mac, I can use the following script succesfully: tell application "Finder" open some file of (folder ("⁨⁨Users:chris:Desktop:photoAlbum")...
0
votes
0answers
57 views

How to move all open tabs from Firefox to Safari?

Someone else asked a similar question but it was for moving tabs from Safari to Firefox. I've used this AppleScript and it works great: https://superuser.com/a/1210777 tell application "Firefox" ...
0
votes
0answers
26 views

Command or script to send focused window to the background

Does anyone know if there is a hotkey or ApplesSript around for sending the active/focused window (app even) to the background (behind other windows). Not hiding (cmd + h), not minimizing (cmd + m). ...
0
votes
0answers
35 views

What is the most perfect way to record a workflow into AppleScript so I can program it?

I tried to write an AppleScript code to control a music sheet application iReal Pro to create sheets automatically, but I tried so many ways and I still can't get the application UI elements exactly,...
0
votes
0answers
29 views

indesign duplicate filelink and update link

i have indesign file with image inside, how I can duplicate the original image in the desktop and relink to the copy in document? I try this code in script (but he don't duplicate the file): if(...
0
votes
0answers
28 views

Keyboard shortcuts in languages other then english

There is a global problem with keyboard shortcuts on a lot of apps (photoshop, sketch, xd... to name a few) which is when you using languages other then english you can't use those keyboard shortcuts. ...
1
vote
0answers
39 views

How to run an Applescript at shutdown

I am trying to track the occurrences and duration of power outages. I have my computer(Mac High Sierra) powered by a UPS and set to shutdown when there is an outage. I have an applescript that when ...
0
votes
1answer
307 views

Is there a way to enter 'tab', 'function' or 'escape' keys as keyboard shortcuts for voice control Mac OS X?

I am using voice control in Catalina OS beta 5 to map various keyboard shortcuts to custom commands. Most key shortcuts like "command-f" work just fine, but any key shortcut that uses either the 'tab',...
0
votes
0answers
24 views

Change “Require password after screensaver/sleep” in High Sierra via the shell

Duplicate of I want to make Macintosh Security Settings Location-Aware and Automatic, Change Mac "Ask for password after screensaver" delay, Toggle "ask for password after screensaver/...
0
votes
1answer
120 views

Automating Image format and size change

I'm a novice, trying to create a Mac OS Automator app or AppleScript that will accept images (PSD, tiff, png, jpeg) when dragged on the app's icon, convert to a different format, and resize them. I ...
0
votes
1answer
60 views

Applescript - Why killall not killing my app

My applescript's app name is "myApp", I'm just wondering why it's not killing my app after the Launch of Tableau. "on run" is working as expected, and killing the host app after launching Tableau, ...
0
votes
0answers
81 views

Mac Automator & AppleScript issues

Thank you in advance for helping me out (if you so choose). I am currently creating an automator sequence that will move .pdf items from a "Bin" folder on the desktop to a variety of folders of which ...
0
votes
0answers
19 views

Forgot macbook recovery key plus hard-drive encrypted

I don't know how my hard-drive got encrypted and now I cannot open my admin account with the password and I don't know what my recovery key is. I have very important files on desktop which I don't ...
0
votes
1answer
129 views

How to play iTunes music from from a script run from the terminal or AIML pattern?

I want to write a command that launches iTunes and play the first song that is in the playlist or song list. I can launch iTunes from my code but it doesn't start the song automatically. My AIML (...
0
votes
1answer
107 views

How can I detect/remove special characters from this short text file?

This is the contents of a short text file created by an AppleScript written by someone else: Search time: Sunday April 28, 2019 at 07:21:07 Search complete. Nothing found. But, when I use cat I get ...
0
votes
1answer
96 views

How can I display the remaining time of a Spotify song on my Touch Bar?

Currently, I'm using BetterTouchTool (BTT) to automate tasks. I was wanting to make a script that would display the time a song has left (in MM: SS format) as a label on my Touch Bar. Here's what I ...
0
votes
0answers
143 views

Why doesn't this MacScript return a valuable on Excel

I have the following VBA Script Dim fileName As String fileName = MacScript("choose file name") MsgBox fileName ✅ If I run the AppleScript in Script Editor, and select a pre-existing file, a path is ...
2
votes
1answer
3k views

How can I automate mouse movement in OS X via AppleScript or a shell script?

Just recently I got into an FPS game and I've wanted to challenge myself to make an anti-recoil script for a while. An anti-recoil script would essentially move the mouse based on a set of ...
0
votes
1answer
46 views

Terminal Command to get app switcher information?

The native app switcher orders the apps based on chronological focus. This ordering is useful to me for a script, but I'm not sure where this ordering information is stored. Is there a way to get the ...
1
vote
2answers
866 views

How to open a random file from a specified folder using AppleScript?

Here's the code I have now: tell application "Finder" get some file of (folder (POSIX file "Desktop/musics")) end tell
1
vote
3answers
900 views

OSX Command line Find Duplicate Filenames with different extensions

I've gone through all the similar questions + installed few command line utilities like duff but with no sucess. In my Images directory, I have images with same name but with different extensions (...
1
vote
1answer
471 views

Is there a way to programmatically open VSCode and then open the built-in terminal in VSCode on Mac?

I am trying to automate the process of opening VSCode and then opening its built-in terminal. I know I can open VSCode easily, but I don't know how I can communicate with VSCode once it is opened. Is ...
1
vote
1answer
114 views

AppleScript - filtering selection (Yojimbo)

I'm currently trying to filter a selection with Applescript. This works: tell application "Yojimbo" to set theYojimboSelection to selection but this does not:    tell application "Yojimbo" to set ...
0
votes
1answer
120 views

How to paste in safari with applescript without pasting in the actual applescript file

I recently discovered applescript and i have been eager to make an internet bot with it. I've built my bot with a memory so it doesn't search the same website twice. I want to keep my memory on google ...
0
votes
1answer
61 views

Applescript to restore foreground color doesn't work

When I attempt to restore a MacOS terminal window's default color by executing the following: osascript -e "tell application \"Terminal\" to set current settings of window 1 to settings set \"...
0
votes
1answer
43 views

Getting error number -1700 when trying to mount a network drive

I don't use AppleScript often but I wrote a short script to mount a network drive based on whether I am home or away: set SSID to do shell script "/System/Library/PrivateFrameworks/Apple80211....
2
votes
0answers
43 views

How can I determine what a read-only script does?

I have been given the task of fixing a series of automated tasks on multiple computers. One of the computers in this automated series is an old Mac running OSX 10.4. There are some scripts on this ...
4
votes
1answer
459 views

Alfred Workflow to move multiple files to Dropbox Folder

I am very new to AppleScript. I frequently share files from my local computer to Dropbox folder. For example: From: ~/Work/hello.txt To: ~/Dropbox/zzz_ShareMe/hello.txt cp ~/Work/hello.txt ~/...
0
votes
2answers
211 views

apple script handler not working in tell statement

Hi I am writing a script that will rename selected files / folders in the format xxxyearxxx to be xxxyear. I am new to apple script, have done plenty of autoit / c++ stuff. I can't get my handler to ...

1
2 3 4 5
8