4

Assuming that the clipboard contains a string of the form /Users/username/path/to/file, this should work: tell application "Finder" to reveal (get the clipboard as string) as POSIX file The use of the verb reveal ensures that, if a path to a file is supplied, the Finder will display that file in its containing folder rather than launching an application to ...


4

If you can use the Terminal, do open "`pbpaste`"


4

You can't execute AppleScript directly from TextEdit. Apple provides an AppleScript editor though in /Applications/Utilities/Script\ Editor.app which makes it easy to create and run AppleScript code. Just navigate to /Applications/Utilities in Finder, run Script Editor and copy/paste your code into it.


4

You can try something like, first copying the text to your clipboard, that you want inserted into Terminal, then have the AppleScript code paste the clipboard into Terminal. tell application "Terminal" activate tell application "System Events" tell application process "Terminal" set frontmost to true repeat while not ...


3

Assuming innerfolder needs to be directly within outerfolder: find /Volumes -type d -name "outerfolder" -exec test -d {}/"innerfolder" \; \ -exec echo {}/"innerfolder" \; (formatted for readabiliy, you can also put everything on one line and remove the trailing \ from the first line)


3

I'm not quite sure of what you are looking for but the following will list all directories named "Virtual Box" starting with the deepest nested to the least. find /Volumes -type d ! -name Volumes -name "Virtual Box" 2>/dev/null EDIT: OK, understanding your requirement a bit better we can use the path predicate to match outerfolder/innerfolder find /...


3

You need to direct the save command to Numbers app... This should work for you. tell application "Numbers" save document 1 in POSIX file "/Users/name/Desktop/Workout.numbers" delay 0.1 close document 1 delay 0.1 quit end tell Or if you want to make the code a little prettier... This should work also. set saveToFolder to path to ...


2

I see that the OP's question says "an application made in Automator." But, as an aside, and since this question has most of the right keywords to solve the problem I was having (applications launched from an Automator "Run Shell Script" action showing up behind other open applications)… If you are launching a GUI application from a shell script action in ...


2

Taking it a step further, this is not quite a direct solution but it incorporates the direct solution within a larger set of commands. This following AppleScript code will copy to the clipboard, the POSIX paths of the item or items currently selected in Finder, only if Finder is the front most application. Otherwise it will copy to the clipboard, the ...


2

If this is something you find yourself needing to do fairly often (and, for some reason, don't wish to have to use Script Editor), then one way to do this is to create a systemwide Service (or Quick Action) in Automator: It will be set to receive text in any application and ensure that the Output replaces selected text. Once saved, you can select the text ...


2

I found an answer. The Lock Screen app on Github does exactly what I wanted to do. So, by downloading it and adding this to my script, I can lock my monitor remotely: run application "Lock Screen" Edit: It seems the application runs the following script: activate application "SystemUIServer" tell application "System Events" tell process "...


1

You don't want to rename the file, just use a new folder path in order to look up a matching file. Automator doesn't include default actions for stuff like that, so you are looking at using a third party action or a script, or doing that part yourself. For an AppleScript solution, create a new service/quick action workflow that receives files or folders in ...


1

Negate your 'fail' structure to make it an 'if not pass' instead. display dialog "Continue" with icon caution buttons {"Exit", "Continue"} default button 1 giving up after 5 if the button returned of the result is not "Continue" then return "exit" else return "continue" end if


1

Here is the scripting definition file for the latest version of Transmit, downloaded today from the Panic homepage. Transmit.app AppleScript Terminology Conclusion: Having read through the terminology and running a few brief tests in Script Editor to pass the time in an Apple Store, I highly suspect it is not possible to use AppleScript to select files ...


1

I've marked the above answer as correct even though it did not solve my problem because there is a lot of other useful code. My unsolved issues: 1. modifier keys are still interfering even with CMD-c trick 2. Clipboard trick alters the clipboard. I could set it back to original value but that changes the history. My solution: Don't run the script till any ...


1

A regular AppleScript saves properties and global variables (including variables in either run handler) in the script itself (the script file is modified). This is how persistent properties have been implemented, but now this can run into accessibility permissions issues, since modifying an application will cause the system to see it as a different one - ...


1

Keyboard Maestro https://www.keyboardmaestro.com/ has a 'Fast User Switch' action. This can be linked to keyboard shortcuts - one for each user. You will still need to enter the password for the user. I suggest you would only buy Keyboard Maestro (US$36) if you intended to use it as an automation tool for other purposes as well as changing user.


1

Here's the roundabout way I achieved it. In Automator write your application, and save it as an Application (foo.app) In Automator, create a separate Quick Action. Get that Quick Action to launch the previous Application you created (launchfoo.workflow) System Preferences > Security & Privacy > Accessibility: Add foo.app to the permissions System ...


1

I just drop the files, pdf or epub, onto the open iBooks window on a mac. The "Add to Library..." menu item in the Files menu also should work. This is on 10.13.4, but earlier systems behaved the same. So if you can export your books as pdf or epub documents, they should easily transfer.


1

My first thought would be to create them as Automator Services (or Quick Actions in macOS Mojave and above). Doing this will then add them to the Services menu available within all apps. For example, if you created a Service called Duplicate Folder, you coudl run that from the Services list within any Application menu (e.g. Finder > Services, Safari > ...


1

Easier, but sacrifices security Create an admin account for him on the system. Have him type sudo -u his_short_user_name shutdown -h now He then answers a password challenge with his password, and the system does a "somewhat hard" shutdown. This means apps will not be asked about saving application data, so your half finished Illustrator drawing is ...


1

Yep, I could find online a way to do it. Perhaps there is a better solution, but this works perfectly for me. tell current window set foundProfile to false repeat with aTab in tabs set profName to profile name of current session of aTab if profName is "XXXXX" then select aTab set ...


1

I had the same problem today and found this way out: set theChoice to choose from list is returning the list's choice or "false" when the user clicks "Cancel" So I used it for a loop – honestly quite a bit dirty, but it works. repeat until endloop is true set theChoice to choose from list if goTo is not false then beep display ...


1

Need to use "Set Value of Variable"


Only top voted, non community-wiki answers of a minimum length are eligible