New answers tagged

0

From Terminal on macOS Catalina 10.15.1, exiftool -ver returns 11.78. I used the ExifTool-11.78.dmg from https://exiftool.org to install it. exiftool -all= filename does not make a backup, nor does exiftool -overwrite_original -all= filename; however, in both cases a filename_exiftool_tmp file is created during the process and I'm just left with filename ...


1

As I do not have access to the web app you are using, I really cannot test if this will work for you. The example AppleScript code, shown further below, with limited testing works for me as coded under macOS High Sierra. Overview: Gets the selected text in Google Chrome and places it on the clipboard in the chosen color as HTML data, and pastes it back ...


2

If you're running it as an Automator quick action, then you can close all windows except the frontmost window of the frontmost application by using the code below inside a Run AppleScript action (you can delete any sample code that appears, including on run {input, parameters}...end run: tell application id "com.apple.SystemEvents" to tell the first process ...


1

Yes, it is simple and there is no need, in this case, to involve System Events. Just ask Notes directly if the window exists, e.g.: tell application "Notes" exists window "Notes" end tell This returns either true or false, however the code in this form may not be as useful as either wrapping the query in an if statement block or assigning the results ...


1

You can do this with the System Events application - for example: tell application "System Events" if exists (window "Terminal — -zsh" of process "Terminal") then display dialog "Found" else display dialog "Not found" end if end tell Note that process is case sensitive while window is not. Therefore this will work if exists (...


1

Please try this. It might run faster. (edited my original answer with new code). tell application "Finder" set theWindows to {} set theCount to (count of windows) if theCount is greater than 1 then repeat with i from 2 to theCount set theWindow to window i copy theWindow to end of theWindows end repeat ...


0

If you want to run this in Terminal you can use find /path/to/top/of/source -type f -iname '*.epub' -exec cp '{}' /path/to/target/ \; This will duplicate all files, which might be heavy on disk space depending on the number and size of your Epubs. You can also just link them by using find /path/to/top/of/source -type f -iname '*.epub' -exec ln '{}' /path/...


0

There are actually many different ways to do it in Automator! Here is one set of actions you could use: Ask For Finder Items Get Folder Contents Filter Finder Items Copy Finder Items


1

I just found the answer! You just need to drag the variable from the bottom of the screen into the desired text box.


1

Your run handler looks lifted from Automator, but your desire to have it as a script invoked from the shell suggests it's designed to be run independently of Automator. Here's an edited form of the script that you can copy and paste into a terminal (like iTerm): (:(){ paste - << SCRIPT > "$*" && chmod +x "$*" #!/usr/bin/env osascript on ...


1

Right after tell application "iTerm" add: if (window count) is equal to 0 then reopen This will open a new window if none are open but iTerm is running. You can also use the following example AppleScript code to make sure window 1 exists before continuing, if one wasn't already open. if (window count) is equal to 0 then reopen repeat until exists ...


2

The stream editor sed is likely the fastest and sharpest tool built for exactly this task. Use the insert command (the newline after \ is part of the syntax): sed 'i\ X' file > newfile $ time sed 'i\ X' line250000 >/dev/null real 0m0.118s user 0m0.102s sys 0m0.012s The delay or overhead for this operation is ...


9

To prepend X to the start of every line of file, writing to newfile, in Terminal: sed 's/^/X/' file > newfile Here I'm using sed, the Unix stream editor, to use a very simple regular expression to substitute the beginning of every line (the ^ symbol) with an X.


1

This bash snippet will prepend each line of a file with a hash (#) and save it to a new file: IFS=$'\r\n'; printf '#%s\n' $(</path/to/file.txt) > /path/to/newfile.txt Explanation IFS=$'\r\n': This sets the field separator so that only the characters \r (carriage return) and \n (newline) are used to delimit a string. The default setting can be ...


10

Prepend each line of a file with a capital A and write a new file- awk '{print "A"$0}' < FILE > NEWFILE


1

To make an ApplesScript droplet app, save the following example AppleScript code in Script Editor as an application: on open droppedItems repeat with droppedItem in droppedItems do shell script "/usr/local/bin/exiftool -all= " & ¬ quoted form of POSIX path of droppedItem end repeat end open Now drag and drop the target file(...


3

After doing a bit of research, it turns out that the -i option for ffmpeg takes a single filename and when converting a number of image files to a .mov file, it has to be in the form of e.g. %05d.png. Obviously the padding of the sequential numbering can be a different number of digits and the image type extension can vary as well. Then to that end, the ...


1

Automator can ‘Run AppleScript’, and you can click at a coordinate using AppleScript: tell application "System Events" click at {123,456} end tell How do I make the mouse click at current location using AppleScript?


-1

You need to grant the Finder full disk access: Open Security & Privacy preferences Go to the Full Disk Access option. Click the plus button. Locate the Finder in /System/Library/CoreServices/ (or simply type 'Finder' into Search). Compare Grant “Full Disk Access” to Workflows run via the Services menu.


0

Yes, but still only (* Catalina era) if you use "Run JavaScript" (or Shell Script) instead of "Run AppleScript". Using the "Run JavaScript" option, a complete download-email-bodies automator recipe can look like this: * Get Specified Mail Items [mailbox "Important" of account "Google"] * Filter Mail Messages [Date Received] [is today] * Run ...


Top 50 recent answers are included