Skip to main content

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
0 answers
29 views

Apple Numbers RegEx works in RegEx Support website does not work in Apple Number) [closed]

RegEx.Extract Negative lookahead help needed due to what works in RegEx Support website does not work in Apple Numbers (I tried (?<=XYZ((?!\d+).)*)\d+). Assume I have the following two cells in ...
panes-rubrics's user avatar
0 votes
0 answers
12 views

regex to find non-price consecutive digits not immediately after certain word for Apple Numbers [closed]

How to find invoice number from different companies which may have different order of invoice number, unit cost and total cost? Following is specific example of a company XYZ which I need to get ...
panes-rubrics's user avatar
1 vote
0 answers
18 views

How can I assign a keyboard shortcut to a process to open a Spotlight window and repopulate it specific filter(s) (eg. "Kind" == "Folder")

My current process to search for a specific directory listing uses Spotlight wth filters in a regular Finder window. I add file attribute filters to refine my search to folders only, and sometimes a ...
wide_eyed_pupil's user avatar
4 votes
3 answers
1k views

How can I have a non-elevated script execute another specific script as root without requiring a password from the user?

I have a script, let's call it on-event.sh, that's going to be run at specific times, such as when a particular application launches or quits. The script itself will run as the current user (not root) ...
Bri Bri's user avatar
  • 2,518
4 votes
0 answers
82 views

Shell script hangs when run with a shebang line

This didn't used to happen, but now when I try to execute a shell script in my path by name, it just hangs. The script: ~/bin/foo: #!/bin/sh echo this is foo My PATH: /usr/bin:/bin What happens ...
Edward Falk's user avatar
  • 1,033
0 votes
1 answer
25 views

Run Applescript by default in log mode

From AppleScript, I can run another AppleScript with set myScript to alias ((path to scripts folder as text) & "testScript.scpt") run script myScript I can also show the log window, to ...
emonigma's user avatar
  • 1,047
0 votes
1 answer
73 views

Why does my script to copy folders fail?

I need to make a local copy of everything within the iCloud Drive folder. Here is what I have so far: #!/bin/bash #make archive folder is desired location mkdir /Users/username/iCloud\ Drive\ Archive ...
jdbj's user avatar
  • 9
1 vote
0 answers
25 views

Is there an app or tool I can use to make it so that a script will run every time a certain application launches or terminates, without polling?

I want to run a simple shell script any time one of a few different applications terminate. I can identify the applications by their filename, bundle ID, or full path, so any method that can use those ...
Bri Bri's user avatar
  • 2,518
-1 votes
1 answer
44 views

Issue with running SH file [closed]

I am trying to run the file run.sh with the command sh run.sh However, I get the error of permission being denied whether I use sudo or not. shloakagrawal@shloaks-air EaglerGradle-1.0 % sudo sh run.sh ...
Buddy Agrawal's user avatar
0 votes
1 answer
48 views

How to make this script successfully trigger at a certain time?

I'm not an AppleScript coder or a technical person by any means but I have done some research and came across a solution for my problem statement. My problem statement How to make a mouse click ...
Anshu Chang's user avatar
0 votes
0 answers
16 views

Wrapper around ssh causes AppleEvent handler to fail

I have the script that I've pasted lower down in my path and named ssh. The idea is that it changes the colour of the terminal based on which host I'm ssh-ed into. This worked fine for a long time, ...
thornate's user avatar
  • 101
0 votes
1 answer
192 views

MacOS - Is there a way to automate a single mouse click at a scheduled time everyday?

I'm trying to find a way to emulate a single mouse-click and I want this action to be performed specifically at a certain time everyday (For example: 6am). It is a requirement related to my work as ...
Anshu Chang's user avatar
1 vote
0 answers
119 views

iOS feature, script or app to quickly determine who's calling based on AI search of the internet?

Most the time when I get a call from a random number, I ignore it, google it, and call them back if I recognise it’s from someone relevant. This process is annoyingly cumbersome for something I might ...
stevec's user avatar
  • 5,085
7 votes
2 answers
2k views

In Sonoma, how can I run applications in /System/Applications from the command line?

I have a shell script I sometimes use to trigger Mission Control, which is simply the following: #!/bin/sh /System/Applications/Mission\ Control.app/Contents/MacOS/Mission\ Control In macOS 13, this ...
Bri Bri's user avatar
  • 2,518
0 votes
0 answers
48 views

Creating an Apple Script to change "Show as Wallpaper" option in "Screen Saver" pane

I am working on a project, and it requires toggling the "Show as Wallpaper" option to True automatically. I've tried using my limited knowledge of Applescript and looking it up, but to no ...
HarlanCheese's user avatar
1 vote
1 answer
48 views

Can't get shell script to talk to AppleTalk script in Automator

I'm trying to make an Automator Quick Action that will: Take a highlighted word, look it up in a database, allow the user to pick from among the hits returned by the database, and put the user's ...
Jan Steinman's user avatar
1 vote
0 answers
52 views

Custom protocol handlers in Sonoma

I want to be able to insert hyperlinks into Calendar entries, such that when I click them, then the command /opt/homebrew/bin/emacsclient -n --eval '(org-open-link-from-string \"" & ...
user64060's user avatar
3 votes
1 answer
70 views

Bulk copy/export name, Modification & Creation Date from multiple files in a folder

I have a bunch of files inside a folder that I want to get the Date Modified and Created from and copy it into a text document or some kind of tab delimited document. I have no idea how to do this. ...
GodzFire's user avatar
0 votes
0 answers
40 views

Problem when trying to make script as an app MacOs

Followed this procedure: Mac OS X .app with a shell script and when i double click the "my app"icon from applications folder nothing happens(it doesn't run).When i go deeper: "my app&...
Iakovos Bitsakis's user avatar
1 vote
0 answers
50 views

osascript keystroke character case with VMware web console

Looking to get the ability to simulating typing a password into a vm console. Figured osascript and keystroke should be the answer. If I run the following I get what I believe to be the correct ...
azzid's user avatar
  • 213
1 vote
2 answers
1k views

How can I toggle Natural Scrolling in macOS Sonoma 14.0 without using third-party software?

I want to toggle natural scrolling without using third-party software, as is done here and here. However, these scripts no longer work in macOS Sonoma 14.0 because the layout of the System Settings ...
user5104897's user avatar
2 votes
0 answers
111 views

Why is a macOS app whose executable is a shell script launching as x86_64 on an arm64 mac?

I have a macOS application whose executable is a shell script. That is, the file in its Contents/MacOS subdirectory whose name is specified in its CFBundleExecutable property is an executable shell ...
Bri Bri's user avatar
  • 2,518
3 votes
2 answers
181 views

Check if display sleep on Apple Silicon in Bash

I have a Bash script that performs certain actions when the Mac enters sleep mode. The script worked fine on my Mac with an Intel chip, but it can't detect whether it's sleeping or not with Apple ...
Piero's user avatar
  • 150
0 votes
1 answer
39 views

How to tell Applescript to call a Fondation's class's init?

A subquestion could be: how to find the AppleScript name of a class's instances? Context: I use the following to access NSTimeZone variables and apply methods. use scripting additions -- essential to ...
Recycleur's user avatar
0 votes
1 answer
108 views

How to execute zsh script at logon which output will be visible in the terminal window?

My default command line app is iTerm (version?) on macOS (version?). I run my script at logon, (System Settings -> Login Items -> Open at Login + myStartScript.zsh) but the script output is not ...
user1146081's user avatar
1 vote
0 answers
75 views

How do you disable "suggest completions while typing" autocomplete feature while editing Applescript in Automator?

I think in a recent update to Ventura they added an autocomplete feature to Applescript editing. In Script Editor, there's a setting to enable or disable "suggest completions while typing". ...
j33205's user avatar
  • 25
0 votes
0 answers
19 views

Scripts menulet env issue

For many years, I have used the Scripts menulet (enabled from the preferences in Apple's Script Editor), which provides a little drop-down menu to trigger scripts -- not just AppleScripts, but shell ...
benwiggy's user avatar
  • 36.5k
0 votes
1 answer
869 views

How to Count in an iOS/macOS/watchOS Shortcut?

It feels fairly ridiculous to me that you can't do a simple increment of a counter inside a shortcut that works with all three major shortcut platforms: iOS/macOS/watchOS. There is a repeat_count ...
Christopher Allen's user avatar
0 votes
0 answers
66 views

dsconfigad - Responding to terminal question

I am "very" new to making scripts, so please be patient with me. I am using Meraki console on where I work and im trying to create a script for the apple devices to join out active directory ...
Mark Boughton's user avatar
0 votes
0 answers
185 views

Command line on IOS IPad Air 4 (I’ve been hacked)

I have found multiple instances where the only possibility is that I am being remotely hacked through screen mirroring. I believe this for the following reasons: Remotely I have found open tabs/...
Sick and tired of being hacked 's user avatar
0 votes
1 answer
79 views

Expected end of line but found "/"

I am updating a script that was written by someone previously in my position but it will not compile due to the error above. This is my first time using AppleScript, so I am very much a beginner. I ...
Connor Eddy's user avatar
0 votes
1 answer
194 views

Create GateKeepr exceptions for all files in a folder

I downloaded a software in tar.gz form. It is built from a bin folder and lib folder. It is blocked from running since files are from the Internet. I wanted to make an exception for the program yet ...
GeorgeIrwin's user avatar
2 votes
2 answers
257 views

Create script that run command as admin ,but allow non sudo/admin user to execute it

I want to run below command networksetup -setMTU en0 1280 but this requires admin credentials networksetup -setMTU en0 1280 ** Error: Command requires admin privileges. I want to create a ...
gladiator's user avatar
  • 123
3 votes
2 answers
215 views

Can I use the output of a shell script to set env vars from launchd?

I'm using launchd to set an env var at startup using launchctl setenv. The script works fine when the variable is hardcoded in it, but unfortunately I need to get this variable dynamically at startup ...
VMX's user avatar
  • 41
1 vote
1 answer
80 views

What are some scripting methods that could autofill an iPad?

I've recently went into a new IT job for my school and we're in the process of removing the activation lock on all of the school iPads. I was wondering if I could hook up my laptop (on Windows) to one ...
Selisine's user avatar
1 vote
0 answers
17 views

How to run a cron job using launchd? [duplicate]

I have a simple cron job: MAILTO=“” 0 9 * * * /path/to/job My issue with this job being that it won’t run if my Mac isn’t up and running (sleep mode). I read launchd/launchctl may be what I’m looking ...
user129393192's user avatar
1 vote
1 answer
231 views

ps return pid/name of process that called script.sh

I am running an app that calls script.sh and I would like to retrieve the invoking app's PID or name within that same script.sh. Ultimately, in my script.sh, I am trying to determine whether the app ...
John's user avatar
  • 1,071
1 vote
0 answers
27 views

Is there a simple way to start a bash script at login or startup WITHOUT revealing the terminal? [duplicate]

I know similar questions have been asked on forums, but due to the constraints of my script, the other solutions are either too complicated or do not work. Please forgive my lack of knowledge in the ...
hidden_machine's user avatar
1 vote
2 answers
158 views

Escape control characters in bash script

I need a solution to escape control characters from a string. What I need is to turn this: %f4^rH13#b$rHN into this: %f4\^rH13\#b\$rHN I found a solution working with GNU sed on stackoverflow, which ...
Nils's user avatar
  • 141
0 votes
0 answers
143 views

macOS - run bash script when specific URL is clicked

Is it possible to write an AppleScript or macOS service/daemon to detect when a URL is clicked (which would launch the browser) and run a bash script as well/instead? Use case: detect when github.com ...
Tom Oakley's user avatar
1 vote
0 answers
631 views

Download file from iCloud/GoogleDrive from Terminal or script

I use Ventura with iCloud and also GoogleDrive. I have some files in iCloud, not physically available on my MacBook, but I could right-click on it and click to "download now" (basically OS ...
Ento's user avatar
  • 11
1 vote
2 answers
422 views

Shell script application bundle prompts for Rosetta installation

I exported the following line of AppleScript code into an macOS application via the "Script Editor": do shell script "open '/Applications/Google Chrome.app' --args --proxy-server=...
Simon L's user avatar
  • 11
1 vote
1 answer
277 views

How to Implement a Dictionary Look Up Script on Mac and Save to History Log: Need Help with Syntax Errors

After several times of having my MacBook shutdown and losing the several tabs I had opened of the words I looked up, I've started to look for a solution. I'm currently trying to implement a script ...
bittscoterie's user avatar
1 vote
1 answer
378 views

Query whether MacBook is plugged or on battery from shell script

I am writing a shell script that I will leave running in background for some syncing tasks. I would like this script to behave differently depending on whether my MacBook is plugged to a power source, ...
a06e's user avatar
  • 272
2 votes
1 answer
284 views

Script to run Apple Inbox Rules

Note: I am not asking how to create a rule which runs an Applescript. I want to go the other way around: run a script that will apply existing rules to all the messages in the inbox. That is, simulate ...
Andrew Lazarus's user avatar
2 votes
0 answers
122 views

Automator workflow crashing silently when ran as Finder extension

I made an Automator workflow that essentially runs a shell script to optimize images. I intend to use it as a Finder.app extension, by selecting images and running the workflow as a "quick action&...
Robin Métral's user avatar
0 votes
0 answers
115 views

How do I use launchctl to hook a shell script to a login / logout event?

I have been trying to get a shell script to fire on login / logout events on a Mac, but the method I used is very old, and it does not work. I followed this StackExchange post and used the sudo ...
Umbrella_Programmer's user avatar
1 vote
1 answer
271 views

How do I point the mkdir to the Desktop using bin/zsh? I am on macOS $HOME

How do I make this create the directory on my Mac desktop rather than the home folder alone. mkdir -p "$HOME/${digits}_${date}" Right now it goes to /Users/name/ I need it to go one more ...
Denise's user avatar
  • 13
1 vote
1 answer
95 views

Undentified shell script "open" added to open at login

Logged in into my laptop this morning, to see that a shell script "open" has been added to open at login. Its from an unidentified developer, created a month back, but just got added to ...
epodegrid's user avatar
1 vote
0 answers
14 views

Mac Automator - When given a folder containing many files with the same name format, organise the folder with new sub-folders [duplicate]

So I have a folder which contains many .mp3 and .cdg files (setting up a Karaoke system 😅) All of the files follow the same naming system: Artist - Song name [Karaoke] Rather than having all of the ...
jamesxdigital's user avatar

1
2 3 4 5
16