Questions tagged [applescript]

AppleScript is the Mac OS scripting language.

Filter by
Sorted by
Tagged with
0
votes
1answer
25 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
10 views

Applescript editor camera access [migrated]

I'am trying to use imagesnap inside applescript but when I run my script in editor it hangs. If i run imagesnap in terminal it does the job. Here is the code : do shell script "/usr/local/bin/...
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
36 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
139 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
17 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
52 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
189 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
156 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
67 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
46 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
20 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
122 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
46 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
34 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
38 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
261 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
22 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
112 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
0answers
24 views

PowerPoint Macro for Mac - load pictures like “Insert Photo Album”

PowerPoint on the Mac doesn't have the Insert Photo Album functionality which allows you to select images and new PPT created with one image on each slide. I have an old macro that does this on ...
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
79 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
122 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
92 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
90 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
139 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
782 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
792 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
427 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
112 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
111 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
42 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
436 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
203 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 ...
0
votes
3answers
558 views

Applescript how to open network window of Audio MIDI Setup

I'm trying to write an Applescript to create a network audio connection using the Audio MIDI Setup (/Applications/Utilities/Audio MIDI Setup.app). I'm not able to open the Network Setup window. There ...
0
votes
1answer
75 views

OSX File Renaming Issue

We have over 15000 images that need renaming. Is there a simple way to find text in a file name (from a csv file) and replace text in a file name (again from a csv file)?? Eg. File Name - AA021 ...
2
votes
1answer
76 views

Moving two specific files into its parent folder within multiple directories with unique names

I need to move two specific files, we'll call them fileA.txt and fileB.sh into its parent folder. One of these files is generic but the other file is specific to its parent folder and can't be ...
0
votes
1answer
210 views

AppleScript - Advanced functions to improve steps / reduce code

I'm trying to reduce the number of steps and and increase performance for my applescript, I just wondered if there are some common functions I can employ. Here's an example script... tell ...
1
vote
1answer
441 views

AppleScript - How to Search result for a string?

I'm trying to search the result of an AppleScript to determine if a string appears. Running this code: tell application "System Events" to tell process "Box Sync" to ¬ tell menu bar item 1 of ...

1
2 3 4 5
8