Questions tagged [script]

A collection of commands that may be from a CLI Shell, or programming language such as AppleScript, which are executed in order with limited iteration, usually as a way of automating actions or events.

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

Need a script to connect to wifi based on user logged in

I know nothing of macs, just windows, but I need a script to connect to a specific wifi ssid based on the currently logged in user. Is this possible? This is not a school project; I need this for my ...
herboren's user avatar
0 votes
0 answers
141 views

A simple way to replace date created with last opened date? [duplicate]

I have a huge number of files that were copied into an old OS X 10.6 server. Problem is there are a large number that came over with a time last opened but no create or modified dates. Is there a ...
Jim Sales's user avatar
0 votes
1 answer
1k views

Auto run a shell script when connecting to a network? (wifi or utp)

Is there a way to make macOS run a custom script whenever it (re)connects to any WiFi or Ethernet network? Basically, whenever my macbook connects to any network (wired or wireless) I would like to ...
RocketNuts's user avatar
  • 1,399
1 vote
1 answer
77 views

Extract e-mail addresses from large text file [closed]

Is there any way I could search through a load of text documents and extract the email addresses from it into one new document? I have this so far in Automator: #!/bin/bash Report=/Users/me/Desktop/...
Appalling's user avatar
  • 146
1 vote
1 answer
83 views

Trigger custom script on specific log message

I am using AirServer for Airplay on my Mac. As far as I know, AirServer does not provide an interface to run scripts on specific actions. However, I found a AirServer specific message inside the ...
bbuecheler's user avatar
0 votes
0 answers
79 views

file not found error in shell script called from Automator

I want a shortcut to a script that merge video and audio. If I go in terminal to the directory documents/convert and run the script with ./script.sh everything works. If I copy the script in ...
Tom Vanwinkel's user avatar
0 votes
0 answers
32 views

Create GIF from Screenshots

Hello everyone, I need to create a program to take a set of screenshots and converrt them into a GIF. I've currently got this code in Shell which works, but the output is quite choppy. cd "~/....
Noah Evans's user avatar
0 votes
1 answer
274 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 ...
erotsppa's user avatar
  • 4,779
0 votes
1 answer
130 views

how to set afplay as default media player for wma files in mac OS

Hi I am using a vim plugin named eblook which turns vim console into a dictionary. The problem is that the implementation of the plugin is using a default player for WMA file to play the sound file (...
Huibin Zhang's user avatar
1 vote
0 answers
31 views

How can I fix my USB volume control from changing the volume two steps at a time?

I have this USB volume control, but when I adjust the volume, it adjusts it two steps at a time. When I connect it, it registers as a USB keyboard. My guess is that it is sending the "keypress" for ...
Ben Holness's user avatar
0 votes
1 answer
448 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 ...
FBI Surveillance Van's user avatar
2 votes
2 answers
179 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 ...
FBI Surveillance Van's user avatar
0 votes
1 answer
77 views

Run Script Atomically

I have a launchd task that runs a bash script periodically, and this works great. However, if I change the script while the task is running, either by editing it directly, or swapping it with an ...
Haravikk's user avatar
  • 1,317
1 vote
1 answer
75 views

"File is Locked" message for a folder with thousands of subfolders/files

After transferring a massive code project to my Mac, I noticed I couldn't write anything to the files inside due to the "File is Locked" plus an access denied message. Unlocking the root folder didn'...
Coruscate5's user avatar
2 votes
3 answers
3k views

How do you git fetch all repos in a folder?

I keep all the repositories I work on in a folder on my machine ~/Code, and I want a script to execute git fetch && git status against each of the repos in that folder. I imagine that, if it’...
Lucas's user avatar
  • 249
2 votes
0 answers
30 views

How to script Catalina Security & Privacy Preferences

In my line of work we use LanRev for our remote management. However, with new machines using Catalina, we've had to manually allow Full Disc Access in order for remote control to work. Is there way ...
Matt in IT's user avatar
1 vote
1 answer
316 views

Can't authenticate using SSH key when running script via launchd

I have a Bash script that executes an rsync command to sync files with a remote server. #!/bin/bash rsync -auvzP --exclude=.bundle --exclude=node_modules --exclude=tmp '/Volumes/Norman Data/me/....
Daveh0's user avatar
  • 325
0 votes
1 answer
188 views

MacOSX El Capitan - Running bootstrap-vcpkg.sh results in a build stopped: subcommand failed, any solutions?

When running sudo ./bootstrap-vcpkg.sh, the script stops resulting in a ninja: build stopped: subcommand failed. I have no idea how to continue from here if anyone could help that would be greatly ...
4-gent's user avatar
  • 11
1 vote
1 answer
146 views

MacOSX El Capitan - After using command line to create a new user, why won't the user appear in the login screen on bootup?

Using sudo dscl to create new users with and without admin privileges. The newly created users for some reason are not in the login screen on bootup and using the input entries for users do not login ...
4-gent's user avatar
  • 11
0 votes
1 answer
77 views

Show FaceTimeNotificationCenterService

I wonder how I can show FaceTimeNotificationCenterService again if I run the command killall -kill FaceTimeNotificationCenterServicebefore?
Tak's user avatar
  • 333
3 votes
1 answer
3k views

How to add a confirmation prompt window to warn before closing a window for any application?

This is about adding a Warn-Before-Closing Confirmation Dialog Window to all application windows in macOS before closing a window. How do I add a Confirmation Dialog Window when I click the Red X ...
Arlen's user avatar
  • 135
0 votes
1 answer
245 views

Automator/AppleScript: move folders to a location based on their name

I'm very new to scripting and Automator but I am trying to figure out a way to have folders automatically moved to a desired location based on the beginning and ending of their names. for example: If ...
Pete's user avatar
  • 1
2 votes
1 answer
584 views

AppleScript 'choose from list'. How can I run a different command if multiple sections are chosen?

I have an AppleScript which manages my home made After Effects render farm. The farm is made up of three render machines. The script asks the user to make a selection of what machine(s) they want to ...
markpaterson's user avatar
2 votes
1 answer
645 views

Run shell script by double clicking in non-login prompt in terminal

This question is super similar to this, but I'm curious how to launch the shell script in a non-login shell prompt. I already have it set up to run with iterm2 when I double-click. I don't really care ...
Captain Man's user avatar
3 votes
1 answer
177 views

How to delete directory content with launchd

I am trying to empty a directory at the end of the day, so I have written the following script: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...
Alex's user avatar
  • 1,432
0 votes
1 answer
355 views

Where to find docs for the supported actions for `tell application` statement

Where to find docs for the supported actions for tell application statement. Similar to tell application "Finder" to close every window How can I know that Finder is supported and also close every ...
faressoft's user avatar
  • 103
0 votes
0 answers
140 views

Requiring user input in order to run a script which controls Safari

Using Script Editor, I've created the following script to close tabs and open a particular window: tell application "Safari" repeat with i from (count of windows) to 1 by -1 repeat with j ...
mega4m's user avatar
  • 1
1 vote
1 answer
115 views

How to find the "configure" shell script in MacOS Catalina?

In order to compile Grace-5.1.25 I need to run configure first. But configure does not seem to exist. In earlier versions of MacOS I used configure several times. Does anyone know where I can obtain ...
Peter R's user avatar
  • 21
0 votes
1 answer
240 views

Running perl shell script from AppleScript on Mojave

I have a simple AppleScript that calls a perl shell script to replace a string with another string (here one with two) in files with specified file extensions (here .txt and .xyz). It used to work ...
jan's user avatar
  • 748
1 vote
0 answers
138 views

How to open a window and tab in Terminal via Javascript automation

I want to use the Script Editor program to create a script (Javascript) that will recreate my Terminal window and tab setup. I open a few windows, open tabs within those windows, label the tabs, run ...
Rob N's user avatar
  • 1,502
0 votes
1 answer
836 views

Run script on login *as root* on Catalina

In this question, a response details that com.apple.loginwindow login hooks can be used to run script as root on user login. I have followed the instructions by using sudo defaults write com.apple....
agjertsen's user avatar
0 votes
1 answer
374 views

Why does Automator not see new files in subdirectories on a Flash Drive?

I've created an automator app to find all the csv files on a flash drive, then modify and copy those files to a directory on the hard disk of my MAC. The automator app uses a shell script to compare ...
ObjCLearner's user avatar
1 vote
2 answers
2k views

Why would a python3 script not find a module when run in Automator?

I am trying to automatically run a python script using automator. This script python3 ~/Desktop/python/gmaps.py works fine in terminal but not when I try to run it through Automator , I get a "module ...
Mitch Ostler's user avatar
1 vote
0 answers
421 views

ApplesScript, autopress space bar

I am trying to run a script that will double press space bar in a fast sequence after this command repeat 10000 times tell application "System Events" to keystroke "g" using command down ...
BruhDontLack's user avatar
0 votes
0 answers
140 views

How do I continuously check the status of a process and execute something once the process stops with an Apple Script?

I'm using an Apple Script to open an application and transcode a file. What I need to be able to do is continuously check the CPU usage of the process and when the CPU usage hits 0 I need to do ...
mperlman's user avatar
0 votes
1 answer
168 views

Move Dock to another screen edge when unplugging monitor

When I exclusively use my laptop screen I prefer to have the Dock on the left edge, but when I plug in my external monitor I'd like to move the Dock to it instead. Since my external screen is to the ...
Andreas's user avatar
  • 1,861
0 votes
0 answers
99 views

How to execute admin level command via remote login without typing password?

I would like to allow a remote script to access my Mac (Catalina 10.15.2) at the root level. I know that I can enable keyboard-less access at the user level, by using publickey authentication, via ...
Matt's user avatar
  • 522
2 votes
1 answer
1k views

Zip the contents of every sub-folder in a folder in Mac automatically

I have this folder/file structure parent folder --subfolder1 -sub-subfolder -file1 -file2 --subfolder2 -sub-subfolder -file1 -file2 ... I want to: create zip files from the contents of ...
turzifer's user avatar
  • 155
1 vote
1 answer
221 views

Batch Removal of "Where from" Metadata Without a Handler

I have many images that contain the "Where from" metadata in the "get info" section that shows the URL where they were downloaded from. I want to remove this information from all of them at the same ...
David's user avatar
  • 53
0 votes
1 answer
213 views

Having Issues Renaming Files That Are Moved From A New to Old Folder via Applescript [duplicate]

Ok so this is a complex script that I hope someone out-there can help me with because I have spent the entire day trying to figure this out. Lets say I collect cat images from Instagram and I have ...
David's user avatar
  • 53
1 vote
3 answers
325 views

Terminal command to move all loose files into a directory with the file name

I have a folder containing thousands of files and directories. I would like to move all the files that are not contained in a sub directory into a directory and name it the file name, while leaving ...
iwantmyhatback's user avatar
0 votes
1 answer
259 views

How to make and alias list from multiples results of a shell script?

So this is the shell script that I have in my Applescript editor which brings up all of the videos that have been added to my computer today. do shell script "mdfind 'kMDItemDateAdded >= $time....
David's user avatar
  • 53
0 votes
1 answer
204 views

Keep standalone bash script app open after run of script

I have a bash script that I have turned into a standalone macOS app (i.e. I created a folder Script.app which contains subfolders Contents and MacOS and in the folder MacOS resides my bash script). If ...
220284's user avatar
  • 253
2 votes
1 answer
2k views

AppleScript to choose item on web page

Is it possible with AppleScript to choose a clickable element in a web page and click it and if so, can you give me an example?
Yuk's user avatar
  • 23
0 votes
0 answers
20 views

Incorrect validation loop [duplicate]

I made a loop that inserts a number into a string, and by the color of the number (blue - registered, red - missing), using the standard utility Digital Colors Meter determines the color of the number....
MarshmallowRose's user avatar
0 votes
0 answers
38 views

Incorrect validation loop for iMessage [duplicate]

I'm trying to do a number checker in imessage. We all know that there is no such api, so I'm trying to use the tools at hand. The main took with past issues on this site on this topic. I made a loop ...
MarshmallowRose's user avatar
9 votes
6 answers
9k views

How to run script at wake?

I'm looking for a method to run a script (well, a single shell command) when my laptop wakes from sleep. This question has been asked before, but 8 years ago (for OS X Lion), and several of the ...
benwiggy's user avatar
  • 29.9k
1 vote
1 answer
984 views

How to remove metadata from image files using AppleScript?

I am using Catalina. I want to create an application using Applescript which which will remove metadata from dropped image files (onto its icon) using the unix utility exiftool. I tried the following ...
sd100's user avatar
  • 135
0 votes
1 answer
225 views

Can I create a Siri custom voice command that performs actions in an app?

I can't seem to find any docs for this so was wondering if this is possible. I have a SmartThings app on my phone for controlling my Samsung tv. I was wondering if I could create a Siri voice ...
Dave's user avatar
  • 461
12 votes
4 answers
6k views

Do Macs come with any programming language available from the Terminal?

I need to do a few little scripts on my Mac but I don't really want to install Xcode or Python for a full environment, just a quick command line deal. Does macOS come with anything suitable out of the ...
Mr. Boy's user avatar
  • 2,585

1 2 3
4
5
15