New answers tagged

1

You can use a "Run Shell Script" action and sips to downscale your pictures to any value. Add a "Run Shell Script" action, make sure the input method is set to "stdin" (should be the default) and insert the following script SCALEFACTOR=500 while IFS= read file; do sips --resampleWidth $(($(sips -g pixelWidth "$file" | ...


4

on run {input, parameters} is AppleScript syntax, not a valid shell command. If you want to execute AppleScript in the service, use the Run AppleScript action instead of Run Shell Script.


0

This should do the trick: property parentfolder : path to home folder set theFiles to choose file default location (POSIX path of parentfolder) with multiple selections allowed repeat with theFile in theFiles set the_tags to paragraphs of (do shell script "mdls -raw -name kMDItemUserTags " & quoted form of POSIX path of theFile & " |sed ...


1

A couple years back I wrote a blog post on performing bulk file operations. The first step was to copy the list of files from search results into a spreadsheet. Since you already have the spreadsheet, you are very close to having a script that can do the renaming for you. Let’s assume you have old names in column A and new names in column B. Write the ...


3

I've found this to be one of the most simple ways: In a spreadsheet column, concatenate: "cp oldfilename newfilename" to create a copy with the new name. Use "mv oldfilename newfilename" to replace the old files rather than copy. Copy this concatenated column to a text file and save as rename.sh in the folder with the files to be renamed. Open terminal, ...


7

export into a CSV: two columns, separated by ; (assuming there is no ; in a file name) open Terminal change to folder containing the files run perl -pi -e 's/\r\n/\n/;' LISTOFNAMES.csv to fix CRLF issues run while IFS=\; read old new; do mv "$old" "$new"; done < LISTOFNAMES.csv PS: This will overwrite existing files if the new name already exists. ...


0

Actually, it IS possible for your first script to write a second script and run the second script 'inside the other' thus allowing you to write keys 'on-the-fly'. Here's a fun demo that toys around with the concept. I hope it helps! --WRITE KEYS TO 'ASOCIATIVE ARRAYS' on theFLY!!!! (a.k.a. applescript 'records') --THIS SCRIPT RANDOMLY GETS A KEY TO EXTRACT ...


0

Write a script, use something like pageres. Check out this list , in the "Screenshot Utilities" section, you'll find many links to utils, APIs and web services.


0

Try this alternative approach in Automator. Be sure to back up any PDFs before applying this workflow – the originals will be overwritten. In Automator.app, create a new workflow and add the following actions: Ask for Finder Items, with Allow Multiple Selection Apply Quartz Filter to PDF Documents, selecting the Reduce File Size option When run this ...


0

You can install Growl. It can be configured to logs all the events including Push Notifications.


0

This is not necessarily meant to be a complete answer and is too much as a comment. Because the Mail AppleScript Dictionary lacks some verbs, e.g. send again, one therefore needs to workaround any shortcomings. The code below could be incorporated into your script. It uses System Events to manipulate menu commands to send composed messages from the ...


0

So apparently I had to disable rootless system integrity protection just to move the workflow file between folders. I still hope someone finds a better way of installing services in the mail app in el capitian, because having to do multiple reboots and disabling low level security features seems excessive when I'm just trying to pull data from two basic ...


0

You could use a script like this: --Select some files in the Finder first. Then run this script. set oldDelims to AppleScript's text item delimiters set the_strings_to_strip to {"ee", "shot", "Z", "at"} tell application "Finder" set the_files to the selection -- repeat with a_file in the_files set the_name to name of a_file ...


0

It is generally advisable to enclose a variable in double quotes. Use the echo command to return the "renamed-svgs" folder rm -rf "$@"/../renamed-svgs cp -rf "$@"/ "$@"/../renamed-svgs echo "$@"/../renamed-svgs/ Or use the find command to return files whose name start with icons_ rm -rf "$@"/../renamed-svgs cp -rf "$@"/ "$@"/../renamed-svgs find ...


3

This AppleScript ask you to choose some files, after that, it set the comment of each file to the file name. set input to choose file with prompt "Select files (to put the file name into the Spotlight Comment)" with multiple selections allowed tell application "Finder" repeat with i in input tell item i to try set tName to (get name) ...


0

This error is exactly what will happen for bash scripts if the application it is communicating with isn't a Running Application when it's interacted with. As for a better way to perform the task, no, automator is awesome. I know, not a full answer, but I cannot comment and my statement is true.


2

You can do this with an AppleScript. Use the Script Editor in the Utilities folder. Here is a script I wrote for you just now. It works on one folder at a time-- not the top level folder, but the one in your example that is 3587915. When you run this script it asks you to choose a folder. In this example you would open 3587915 and then click "Choose." Very ...


0

Problem was solved using this great answer. Just follow 4 simple steps.


0

Open Automator and create a new folder action. Choose a folder to watch. In my example it's a Mavericks installer thumb drive with the name SystemUSBMav. Then add Launch Application from the Automator's library and choose an application to launch. Save the folder action as Launch on Mount. A second approach is a launch agent: Create a file ...


0

This is the script of a similar bulk erase/copy routine I made with the help of klanomath in this related question - Find specific attached disk, not volume, by Applescript which you need to reference to see how the device name is extracted. I saved the script as an Automator Service, which I then tied to a non-trivial, in fact very hard to do by accident ...


0

Solved my problem by changing the do shell to: do shell script "/usr/local/bin/python3 /path/to/script.py $@" and letting the shebang stay as: #!/usr/bin/env python3


2

Automator uses the path variable hard coded in the kernel. sysctl user.cs_path user.cs_path = /usr/bin:/bin:/usr/sbin:/sbin Actually, this is the path set for a user's launchd and is then inherited by Automator when you launch the application. launchctl getenv PATH /usr/bin:/bin:/usr/sbin:/sbin Use the absolute paths to your executables or modify the ...



Top 50 recent answers are included