New answers tagged

1

Updated Answer I download the trial of BetterTouchTool and resolved the issue in the following manner: Added a keyboard shortcut assigning it: ⇧⌃P Added the built-in Show Color Picker action to the aforementioned keyboard shortcut. Added a Run AppleScript (async in background) action, to the aforementioned keyboard shortcut, with the following AppleScript ...


0

This AppleScript will tell the active application to minimize all windows except the active (aka frontmost) window. set theFrontApp to (path to frontmost application as Unicode text) tell application theFrontApp set theWindows to the windows whose miniaturized is false set theFrontID to the id of the front window repeat with theWindow in ...


1

While user3439894 has provided the correct answer to your question, I would like to point out a simpler solution would be to use the Automator to create an application. Here you would not have to wrap the open -a "Google Chrome" --args --profile-directory="Guest Profile" command in do shell script. The steps are given below. Open the ...


4

You can use the do shell script command, however, I've changed the double-quotes to single-quotes in the open command, so as not to have to escape them with a backslash character. Example AppleScript code: do shell script "open -a 'Google Chrome' --args --profile-directory='Guest Profile'" You can save this as an AppleScript application. Note that ...


-1

I created a small Mac MenuBar-App to automate this behaviour (Scrolly). What is the difference - you may ask - to scrollreverser. The scrollreverser app is really nice but the downside to it is, that it doesn't actually change the settings (which my app does, thanks to you guys and the apple scripts everyone shared inside this thread). If you want you can ...


1

This AppleScript code works for me using the latest version of macOS Big Sur. set filePath to "/tmp/test.txt" tell application "Finder" delete filePath as POSIX file end tell This also works for me… set filePath to POSIX file "/tmp/test.txt" tell application "Finder" delete filePath end tell


0

The only solution that I know of is to approach the problem from another direction. Writing all of your own Automator apps (which are going to continually run into this problem), and trying to find loopholes to make them work? That's going to be a losing battle. You might be able to solve this with SD Notary: Notarizing Made Easy from the folks who make ...


0

While @user3439894 did present a workaround solution I did find the answer to the pbcopy issue with help from a user on Reddit. Hope this provides help at some point in the future. Piping to pbcopy is the correct approach. Since do shell script does not run your login shell (see Technical Note TN2065), you have to supply the locale as an environment ...


1

If you are just trying to replace the - with ▸, then here is how I'd do it: Note that in the example AppleScript code the first and last lines of it are for testing to actually set the expected content of the clipboard to work with, obviously they are not needed in the working code. Example AppleScript code: set the clipboard to "# 6C (d1/s2): F 11-12 ...


0

First of all, huge thank you to user3439894 for the awesome answer provided. This is absolutely what I needed. I did however encounter an issue completing these steps using encrypted APFS volumes, but I found a solution. I'm using encrypted APFS volumes with macOS Big Sur. I encountered an issue running diskutil cs list as it returns "No CoreStorage ...


1

I stumbled upon the same issue of wanting to switch between multiple input sources with keyboard shortcuts quickly since Catalina broke the old method using AppleScript. Although the above methods work, they're rather clunky, unreliable, and slow (at least for me). After a bit of digging around the internet I found a better solution. Someone wrote a terminal ...


1

The example shell script code, shown below, can be used as an Automator workflow created as either an Application or Service/Quick Action, using a Run Shell Script action with setting Pass input: [as arguments] and replacing the default code with it, as shown in the images further below. For each folder dropped on the Automator workflow created as an ...


0

This short AppleScript deletes all Outlook fields from all contacts. Optionally, it can also delete all notes. tell application "Contacts" delete (every url of every person whose value contains "outlook") -- set note of every person to missing value save end tell


0

This following AppleScript code should serve the same function as you are looking for but the results will be almost instantaneous because you will not have to key stroke each individual letter. — Save Anything That Is Currently On Your Clipboard copy (the clipboard) to oldClipboard -- Choose File Whose Contents You Want To Read activate set theFile to ...


1

Update (again) per Comment This first block of example AppleScript code conditionally clicks the Input menu on the Menu Bar only when the Hide Keyboard Viewer menu item exists, thus hiding the Keyboard Viewer. tell application "System Events" tell application process "TextInputMenuAgent" tell menu bar item 1 of menu bar 2 ...


0

Read the file, then extract the paragraph Very simplified... set theFile to open for access myPath set fileContents to (read theFile) close access theFile set myParas to count paragraphs of fileContents repeat with i from 1 to myParas set myText to myText & "\n" & paragraph i of fileContents end repeat tell application "app&...


1

If you want to stop Firefox from opening when not necessary, then change: else if theActiveApp is "firefox" then tell application "firefox" open location urlToOpen end tell To: else if theActiveApp is "firefox" then set |Firefox| to "Firefox" tell application |Firefox| ...


2

Firefox is likely opening because the script includes: tell application "firefox"  … end tell Based on your description, these lines require AppleScript to launch Firefox to determine if the script is correct – even if the involved lines are never run. Firefox needs to be launched for AppleScript to obtain the application's scripting language ...


0

Extending @CJK's excellent answer, neither the ISO-8601 format nor the default Applescript one works for me, and I'm more comfortable programming in Javascript, so I came up with this: If I were programming an app, I would momentjs to format the date, but for this personal Quick Action, it seemed more expedient to brute-force it. Anyway, I don't even know ...


1

For Catalina and Big Sur, use this AppleScript tell application "System Preferences" activate set the current pane to pane id "com.apple.preference.universalaccess" delay 1 #needs time to open universal access tell application "System Events" to tell process "System Preferences" to tell window "...


0

I have improved it and added it as Automator Service, so you can access it anywhere: on run {input, parameters} set my text item delimiters to " " set resultList to every text item of input set text item delimiters to "" set phone to resultList as string -- 123456789 (test) open location "tel://" &...


0

If you are looking to keep your automatic iCloud backups going and have the ability to schedule this script for auto backups, I added in the selection of the radio button for "Back up all of the data on your iPhone to this Mac" tell application "System Events" to tell application process "Finder" set frontmost to true tell front ...


0

The Photos library contains AAE files but they are proprietary and can't be exported. Quicktime will use an AAE file (if you place it next to the original mov) for slow motion videos to mark where the positions (but again it can't be exported). I found that you can filter the photos by 'edited' (though it is not always accurate and sometimes shows unmodified ...


2

There may have been a time when Google Chrome was compliant with AppleScript commands e.g. run or launch, which would keep it in the background, as it does with e.g. Safari and other applications. Or compliant with with the shell open command using either the -g or -j options along with the -a option. In testing under macOS Catalina I could not get Google ...


0

So it turn's out it is simply a timing issue adding delay does the trick: tell application "Keynote" activate show next delay 0.1 set selectedSlide to slide number of current slide of front document end tell tell application "Skim" tell document 1 go to page selectedSlide end tell end tell


0

Works on macOS Big Sur For the Default monitor osascript -e 'tell application "System Events" to set picture of current desktop to "<path-to-img>"' For the second monitor osascript -e 'tell application "System Events" to set picture of second desktop to "<path-to-img>"'


0

For the Default monitor osascript -e 'tell application "System Events" to set picture of current desktop to "<path-to-img>"' For the second monitor osascript -e 'tell application "System Events" to set picture of second desktop to "<path-to-img>"'


3

osascript #!/usr/bin/osascript on open location input do shell script "/usr/local/bin/youtube-dl " & quoted form of input end open location If run as a script, the hash-bang of your script should be the path to osascript. This is the process that runs AppleScript (an Open Scripting Architecture language) on macOS. Quote the URL passed ...


5

What can I do to make my AppleScript run things just like they run in Terminal? Well, you could tell the Terminal app to run your command: tell application "Terminal" to do script "youtube-dl " & input But, I don't recommend this route, because it will actually open a Terminal window! There are a whole host of differences between ...


1

This looks an awful lot like a path problem - you have a script youtube-dl and the program /usr/local/bin/youtube-dl - in your AppleScript, try giving it the full path to your script.


0

Utilize the HEIC format by exporting originals. Multiple operating systems support this including windows via a plugin. https://discussions.apple.com/thread/7644152


Top 50 recent answers are included