Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
11 views

Pinning Apps to dock VIA terminal or installation arguments OS Sierra

I am using meraki MDM systems manager to deploy applications for are teachers. It would save me a-lot of heart ache to be able to include a terminal command or some type of software to help with ...
2
votes
0answers
22 views

How to start an application when iPad is connected?

I would like to start an application (Duet.app) installed on my macOS 10.14.5 whenever I plug my iPad to the USB port. I tried to do it with Automator, but I have no experience.
1
vote
0answers
23 views

How to see LaTeX output in Mail.app?

I frequently receive mails with LaTeX text which appear in normal text like $frac{(1+cos\theta)^2 but I want them to be rendered in Mail.app as it would be written in books. Is there any plugin or ...
1
vote
3answers
157 views

Finding and Renaming Mislabeled Duplicates

I inadvertently formatted a Time Machine backup external hard drive. I was able to recover many of the files, but not the names of those files. All of the recovered files have generic names like "...
0
votes
0answers
18 views

Smart Folder from arbitrary script output?

This is a long shot, but is it possible to create a Smart Folder which, instead of building its search using the Search Criteria UI, but instead use the properly formatted output of necessary for a ...
0
votes
2answers
67 views

Connect and run commands over SSH using script

I'm using a series of commands for deploying my files to production. This is currently done manually. Is it possible to make these commands into an executable file? So that I don't have to copy paste ...
1
vote
0answers
24 views

Help with Apple Script for dealing with duplicates in Numbers

I had a script that I used to find duplicates in a numbers document and to highlight the duplicate in red. Well I now have a file where there are multiples of the descriptor in column B that are ...
0
votes
1answer
26 views

stderr error log from launchd scripts filled with non-errors

I've added versions of the following to each of the launchd plist files for all of the scripts I run on my server: <key>StandardErrorPath</key> <string>/script_logs/server....
-1
votes
1answer
56 views

Automator services replace selected text's spaces with underscore [closed]

Looking to create a simple automator service that I can use when selecting text. If the text has spaces, it will replace it with underscores. Thanks in advance.
1
vote
1answer
68 views

Keyboard shortcut in finder to launch >share via>airdrop

I'm for a way to share a group of selected files I have selected in the finder window, via airdrop, with a simple keyboard shortcut. since you can use cmd+c to copy, I thought there had to be a way I ...
1
vote
1answer
39 views

automating “Reset Advertising Identifier” is it possible?

I want to use osascript or some other way to automate "Reset Advertising Identifier" is it possible?
-1
votes
1answer
21 views

Start a window on top of a full screened space [duplicate]

How can I open a window on top of a full screened space? I full screen a video in Safari. I want to run some app that opens a little window on top of that full-screened video. I don't mind what ...
0
votes
1answer
55 views

How can a script detect if it has access to some Security & Privacy parameters?

I've created a script which uninstalls an application I've created. However, as you may know, in macOS Mojave the system requests the user's permission to allow said script to control System Events. ...
1
vote
1answer
77 views

Automator to remove all text before hyphen ( - )?

I'm trying to create an Apple Automator application that will rename a group of files by removing all text before and including a hyphen ( - ) that will post an error if trying to rename a file with ...
0
votes
1answer
13 views

Power off block devices

I would like a way to shut down the block devices to do safe removal by turning them off. On Linux there is the UDisks2's udisksctl power-off -b /dev/sdX command. Is there something similar? Or if you ...
0
votes
1answer
77 views

How to remove special character from a folder name?

I am creating a folder like mkdir -p ../service/target/static but windows creates it with some special character static. I need to explicitely remove that special character using shell script. I ...
0
votes
1answer
240 views

error “System Events got an error: Can’t get application process \”System Preferences\“.”

When running tell application "System Events" click button "Turn Bluetooth Off" of window 1 of application process "System Preferences" end tell I get the error: error "System Events got an ...
1
vote
1answer
37 views

Monitor Folder Contents with launchd - Including Subfolders?

I want to make a shell script that runs any time the contents of a particular folder on my server are changed. Seems easy enough at first, because launchd has a directive called WatchPaths which ...
0
votes
1answer
26 views

Network proxy setup in terminal

I am trying to create a bash script that will update the mac's proxy settings and a few other places when a user changes their password every 60 days. So far I am trying to use this command for the ...
0
votes
0answers
29 views

Finding a file in Finder with a script

someone please explain why this won't work. The script alone without the "if mainReturned = "File" then" works just fine but when I add it to another part of a script, things get weird. It highlights ...
2
votes
2answers
54 views

Opening a script with a script?

I am using a script and I have a secret code to input within the script (If that makes sense) after I input the code, it is supposed to open the script within the application, the main.scpt. I don't ...
3
votes
2answers
307 views

Getting a text file with the url of open tabs

I got used to this routine my idle times: Open hacker news, SE, other sources on my iphone. Open interesting links as new tabs. Read for a while. Leave tab to remind myself to save it somewhere. The ...
0
votes
0answers
39 views

How to open a second finder window in split view when the current window is in full screen view

Let's say I have a finder window open in full screen view. I'd like to quickly open a second one, where both would be in the same split view. Sort of like using command-tab. And preferably to the ...
0
votes
1answer
49 views

Play folder with right button with iTunes

This answer to Play folder with right button with VLC explains how playing all the audio tracks within a folder can be accomplished when using VLC. I don't want to install VLC, how can I accomplish ...
0
votes
1answer
80 views

Different execution of bash script in 'execute shell script' action in Keyboard Maestro

I try to execute shell script using Keyboard Maestro. In macOS Terminal and Raspberry everything works good. KM shows a strange error. Looks like the script works but poorly recognizes characters or ...
1
vote
1answer
36 views

Create a custom Quick Action to create a zip file with password

How to create a custom Quick Action to create a zip file with password. I understand, to create a zip file with password the following command-line can be used: zip -er archive.zip /path/to/...
2
votes
1answer
391 views

Giving instructions to an executable in UNIX?

I'm pretty new at this, so excuse me if this is too easy. The thing is, I have a bunch of instructions stored in a text file named: 'FTIG_dldStruct.txt' and I want to write them all into an executable ...
0
votes
0answers
25 views

How and why is the osascript command loading a QuickTime component?

I'm trying to figure out what the osascript command is doing under the hood. Whenever I run it, it tries to load a QuickTime component which throws security errors with Mojave installed. See this ...
2
votes
1answer
225 views

Notification center documentation for applescript

Where can I find documentation for notification center method and properties to use it in applescript? I can't find anything in script editor's dictionary neither on web. This is example code to work ...
2
votes
0answers
37 views

Easy way to bulk change folder icons in Mac

In order to change the icon of one MAC folder, all we need to do is: Open the image Copy the image from the menu ("Edit" -> "Copy") Right Click on the folder and click "Get Info" Click the icon at ...
3
votes
1answer
84 views

What does “Cache location entry for Photos.app in cache file” error signify in Automator app?

I have written a very basic script to count the number of files in a folder, then if it reaches 16 files, to run an automator workflow, as below: #!/bin/bash cd /Users/barbooths/Projects/...
0
votes
0answers
20 views

How to display standard output in Mac application converted from shell script?

It's easy to convert a shell script to a Mac App as suggested here. But I am only able to see the operation result of the script(or the Mac App) after the script finished and there seem to be no easy ...
0
votes
1answer
61 views

Script to check to see if certain applications were installed [closed]

I am very new to Macs however I did hear that there was a Bash script that can be utilized to check to see if certain applications were installed on a machine
0
votes
1answer
64 views

Removing Files after Successful Extraction unrar rm shopt globstar

shopt -s globstar for f in **/*.rar; do dir=`dirname "$f"`; unrar e "$f" "$dir" && rm -frv "${f::-2}*"; done From echoing out testing the rm command, the file is the correct path. I ...
2
votes
1answer
38 views

macOS counterpart of Windows startup batch file [duplicate]

My friend pranked me by creating a batch file which opens a YouTube video and added it to the startup folder, so that the batch file launches every time I log in. This is what he wrote in the batch ...
1
vote
2answers
300 views

Launchd running an Applescript every two hours

I have written a small applescript that I would like to run automatically every 2 hours. I have thus written the following launchd daemon (probably it is an agent): <?xml version="1.0" encoding="...
1
vote
1answer
27 views

Double-click bash file -> pwd outputs my home directory instead of the current directory [duplicate]

In my Downloads directory, I have an executable bash script : #!/bin/bash pwd when I double-click on it, pwd outputs my home directory. But I want my script to run from the current directory from ...
3
votes
1answer
66 views

Automator :: Remove 6 digit date from filename; append current date

I apologize in advance if this has been answered but have performed a lengthy search in hope of a solution. I have a working Automator app that appends the current six-digit date (YYMMDD) to the end ...
1
vote
1answer
65 views

Gluing chronologically rtf files via bash script

I like learning and creating small scripts for bash, and now I have finally the first "serious" problem I would like to solve through a script. Here is the situation: I have a folder containing 45 ...
-2
votes
1answer
248 views

A script to shrink and compress DMG disk images does not seem to work well in my scenario

I'm trying to resize the *.dmg of my MAC OS X installation file because I have only DVD of 4.7 GB and not dual layer disks,at the moment. The problem is that the dmg file is almost 7 GB large and I ...
1
vote
0answers
58 views

“sudo chmod 0 /” deployed as script to remote MACs via Landesk

This probably will not make a lot of sense. We have users that have left the company and have not returned their macs. We are using Landesk as main managing platform, however the MAC managing part is ...
1
vote
0answers
18 views

Is it possible to create exs24 files with a script?

Say that I have a hundred samples and want to make an exs24 instrument for each of them. Is there any script where I could input some info like name, key and path to the audio file and then have it ...
1
vote
1answer
360 views

AppleScript, set the position of the frontmost window, even if not AppleScriptable

I am trying to write a script to center the frontmost window of the active app, when I select this AppleScript from the Script menu in the menu bar. It should work with any app, including non-...
1
vote
0answers
19 views

script to switch to fullscreen app space [duplicate]

I would like a script to manage the switch between spaces. I don't want to switch to a specific desktop, but to a fullscreened app (i.e : iTunes). I already tried the activate command in script ...
2
votes
2answers
265 views

How to deploy Automator workflow to clients?

For a specific use case, I've developed a Folder Action workflow with Automator. When a file gets created in a folder 'abc', the workflow kicks of and executes a shell script. This workflow needs to ...
3
votes
0answers
34 views

Automatically send kill -STOP or similar to runaway processes when the lid is closed?

From time to time (maybe a couple of times a week) when I get to my computer (a Macbook Pro) expecting it to be asleep with the lid closed the fans are running Most of the time it is a Chrome process ...
0
votes
0answers
30 views

How can I stop the system changing name extensions of my files?

I have a created an executable Perl script, starting with #!/usr/bin/perl and have called it t. So when I launch ./t on the Terminal the script is executed and everything is fine. But apparently ...
3
votes
2answers
121 views

How do I unmount a drive with a script?

I installed sleepwatcher to run ~/.sleep before my computer goes to sleep. I need to unmount /Volumes/Backup before my computer falls asleep. If I forget to do it, I get a message telling me that I ...
-1
votes
1answer
171 views

How to skip 'Cancel' 'Continue' when running shell script with automator?

I'm trying to run pmset sleepnow linked to a keyboard shortcut with automator. When I use the shortcut, it's giving me a 'Cancel' or 'Continue' prompt. Anyway to skip this so the script just runs when ...
1
vote
3answers
969 views

AppleScript – How can I _get_ UI elements' names, attributes, properties, classes programmatically without “guessing” via AccessibilityInspector?

When I started to search for an AppleScript's generic way to "click onto Safari's context menu" of a selected item, there were a lot of questions on "how-to" on several levels of nomenclature. How ...