New answers tagged

0

I had a similar question and with the help of wch1zpink came up with this solution. In automator: create a new workflow add get selected finder items add run applescript replace the script with this: tell application "Finder" set selectedFiles to selection as alias list set containingFolder to container of item 1 of selectedFiles as alias ...


0

Answer: this is not possible since the list of active previous tabs isn’t stored in a way AppleScript can know how to go back and undo a window close operation.


2

One wouldn't use DiskImageMounter to do this because, despite it giving the illusion that it's scriptable and loaded with commands in its AppleScript dictionary, it never returns a valid reference to any image that it opens; therefore AppleScript never gets informed it's done the job; and DiskImageMounter sacks it off, quits, and invalidates the connection ...


1

All you are doing is returning a list of the last part of the names (if there is more than one delimiter character, the second part) to the next action. Text item delimiters aren't really needed if you are just using the first occurrence of a character, so you can do something like: on run {input, parameters} set output to {} repeat with anItem in ...


1

sudo Being Dangerous There are no dangerous commands, per se. It's what you do with them that can cause problems. For instance, the harmless command yes which will output a string repeatedly until you kill it, can be used nefariously to bring a machine to a crawl: echo "Spawning 1000 yesses" for i in {1..1000} ; do ( /usr/bin/yes & ) ; done ...


1

Sudo is not (in and of itself) dangerous. Sudo merely removes protective restrictions, putting the burden of running safe code on you, rather than protecting you behind the scenes. Sudo can be dangerous when, for instance: You make a coding mistake which has unintended consequences: e.g., if you intend to run: sudo rm -Rf /Users/yourname/something/...


3

You can use: tell application "System Events" to keystroke "q" using {control down, command down} You could also use the following instead: tell application "System Events" set appName to (name of every application process whose frontmost is true and visible is true) as string click menu item "Lock Screen" of menu 1 of menu bar item "Apple" of ...


4

I do not know of a list, per se, however AppleScript supported applications have a dictionary that you can view to see what's available to a given application, besides what available in the StandardAdditions.sdef file of Script Editor itself. While in Script Editor press ⇧⌘L to bring up the Library, where you can double-click on Finder to review what's in ...


2

There already is a Screen Lock button for the Touch Bar natively ! Here is how to set up the Screen Lock button on Touch Bar: Go to the Apple menu and choose “System Preferences” and then go to “Keyboard” Under the “Keyboard” tab choose “Customize Control Strip” Expand the Touch Bar and then drag the “Screen Lock” button into the touch bar screen (drag it ...


0

wifi-location-changer is a project on GitHub which runs the shell script locationchanger every time the Wifi SSID changes. locationchanger sets the variable LOCATION and runs scselect "$LOCATION", you can replace that with your own action.


-1

What you probably need is to insert the right key code command using an AppleScript action in your workflow. In this case it's 100. on run tell application "System Events" key code 100 end tell end run In this article you can learn more about it: https://eastmanreference.com/complete-list-of-applescript-key-codes. You will find this table: ...


1

The following AppleScript should do the job. It removes only an underscore followed by eight digits, e.g. _2020012, at the end of a filename without changing the extension. I don't know how familiar you are with using AppleScripts but you should be okay if you carefully follow the directions below. Sorry that I can't make its creation simpler but, once ...


0

Please... use the nice tool Automator!!! For heavens sake, it did not come with macOS for nothing! So regardless of the Terminal commands that you want to execute, do the following: Launch Automator (which can be found in your Applications folder) Choose Application as the type and confirm by clicking In the Actions, choose Utilities and doubleclick or ...


2

The solution is to source the file dependencies you need inside the automator script. Example if you added all of your scripts to ~/.zshrc source ~/.zshrc deploy You can debug things easier by doing which deploy to check to see if that script is accessible.


0

"The Filter Finder Items action uses Spotlight. Having success after using an item with Numbers.app would suggest that the (newer) external files have not been indexed (yet)." Thanks!! I modified the Automator app to remove the "Filter Finder Items" action (I put this functionality into the Shell Script) so now I have: “Get Folder Contents” (‘Repeat for ...


0

It is not possible to disable drag-n-dropping of icons in Finder for a specific read-write DMG from within the DMG. You should consider creating your installer in a different manner. For example consider using a read-only DMG with an app inside that the user needs to double click. When double clicked it will present a window allowing the user to drag-n-drop ...


1

Solved: I'm not sure why it worked, but running pip3 install pyperclip in the automator window installed it in the correct location for it to be used.


-2

Apple's official page on customizing files and folders works great for this! For the sake of completeness, for others who view this, I am sharing this.


0

Finally, there is no "combine variables" action per say in automator, but you can add a custom text variable, and drag another variable from the library variables into any part of the text in the value field. In my case, needing to combine paths to folders, this is the same thing. create a "text" variable from Variables > Text & Data > Text. Drag ...


0

Actions class in selenium are used to perform multiple actions at the same time. For example, double-click, right-click, moving a mouse, drag & drop, etc.


Top 50 recent answers are included