Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
22 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
46 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
58 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
13 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
32 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
49 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
22 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/...
0
votes
0answers
21 views

How do you react to an AppleScript list choice?

I was wondering, how would you react to a choice that was made from an Applescript list? For example, you have a list that has option 1, option 2, and option 3. When somebody chooses an option, I want ...
2
votes
1answer
385 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
16 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
52 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
23 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 ...
1
vote
0answers
19 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
15 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
33 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
24 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
29 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
148 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
21 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 ...
4
votes
1answer
42 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
56 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
98 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
49 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
16 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 ...
0
votes
1answer
197 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
113 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
25 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
65 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
91 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 ...
0
votes
2answers
456 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 ...
0
votes
2answers
70 views

How to change the `sh` command to run scripts in bash 4

I have installed bash 4 with Homebred and bash --version shows me the version 4. If I have following test script: #!/usr/local/bin/bash # test-version.sh echo $BASH_VERSION And I make it executable ...
1
vote
1answer
71 views

Use security to get a list of Keys in Keychain based on type?

I'm successfully using security to fetch keys from my Keychain via their label, e.g.: security find-generic-password -l "PDF Encryption" However, I'm trying to build a UI that offers me a CHOICE of ...
1
vote
1answer
190 views

Applescript Tell Application of Specific Instance

If I have 2 instances of one application running, and I want to target one of them by their PID to run an Applescript snippet, how would I go about that? I have the PID of the instance I want to ...
8
votes
1answer
3k views

Is there a script I can use to download the Mojave installer without being signed in to the App Store?

Is there a way to script and download the Mojave installer without signing in to the App Store? Something other than opening or clicking a url that points to the installer on the Mac App Store would ...
2
votes
1answer
153 views

Any way to open a URL in a script without having it open in a browser

The situation: My mobile carrier offers for free to send SMS notifications by following a URL. What I'd want: Include these URLs in various scripts to get notifications when I'm away from keyboard. ...
3
votes
2answers
96 views

Difference between filename and . filename in macOS terminal

I'm newbie to MacOS. (I'm using mac OS high sierra 10.13.6) I installed a software. They said to initialize the software by . /path/setsas.sh I give no thought to . and space, so I just ran path/...
2
votes
1answer
61 views

Create macro for Sketch App

I want to create a macro for Sketch. I want to execute some commands, for example, save the file, run some plugins, etc. Is there a way I can do this? I'm using a Macbook Pro with OSX 13, I use this ...
1
vote
0answers
43 views

Formula to calculate the sum of timecodes - AppleScript

After extensive research on the Internet I could't find a decent formula to calculate (add) timecodes, so I'm building my own script from scratch. So far I can get a pretty decent result, however I'm ...
1
vote
0answers
16 views

Automating wifi login

I have a wifi network that loads a webview on connecting that has fields for username and password and a login button. is there a way to automate the login process when that network is connected?
15
votes
4answers
10k views

Mojave: disable or control the “[SOME_APP_NAME] wants access to control [ANOTHER_APP_NAME (often Finder)] …”?

A new security feature in Mojave revolves around a system dialogue that prompts you to grant access to apps that want to control other apps, such as Finder (I'm finding frequently happening with some ...
4
votes
2answers
83 views

Bash - Suppressing output to STDOUT

I've written a script for fresh macOS installs that installs Homebrew, Cask, and a bunch of apps I like, along with creating a .vimrc file. Thanks to an answer by daniel Azuelos (located here: Best ...
0
votes
1answer
69 views

Play startup animation from video automatically at login

I want to add a function to my new install of Mountain Lion... What I want to do is add an autostart process that plays a video (in the .mp4 format) full screen, with audio, and without any controls ...
0
votes
1answer
56 views

How to script a global keyboard shortcut in MacOS

I want to configure a global keyboard shortcut in MacOS using a script. Specifically, I want to set the "Move focus to next window" to ⌘⇧§ (since I have a Swedish keyboard and the default ⌘⇧` has a ...
0
votes
1answer
69 views

Creating AppleScript for keystrokes

I've been trying to do my own AppleScript to make my Mac press C 13 times, press the left arrow key, press C 13 times, press the right arrow key and start from the beginning repeatedly at 1.7 seconds ...
1
vote
0answers
41 views

How to make Spotlight index shell script wrapper applications?

You can create executable Application Bundles containing a script with the same name (e.g. Example.app and Example.app/Example). Unfortunately, these applications do not seem to get indexed by ...
1
vote
1answer
78 views

Applescript to drop down Script Editor in Menu Bar

I want to write a script that will drop down the menu of the script editor from the menu bar, but without selecting a menu item from it. The idea is to give the script a keystroke shortcut (like F15) ...
0
votes
0answers
62 views

Detecting a Floating Menu in Touch Bar with AppleScript

I'm trying to write a simple script using AppleScript that can identify and close a floating menu on the touch bar. An example, for clarity: Suppose that I've opened the Spotify floating menu on the ...
3
votes
1answer
37 views

How to auto paste above return value on command line

I am trying to create a very simple script (.command) that will basically change my mac address.. i do know that the command: openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' will return me a ...