Automator

Hi there,


I had an awesome support for an automator from VikingOSX but Im running into an issue now, I don't know if it's because I updated. The original thread is here: https://discussions.apple.com/thread/251260442?login=true


And now I'm getting this error when I try to run it:


This app was a HUGE time save for me and I'd love to get it working again.


Many thanks,

MacBook Pro 16″, macOS 11.0

Posted on Nov 27, 2020 11:51 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 28, 2020 4:58 AM

Are you attempting to run the Automator solution on the released Big Sur? I have Big Sur running on both an M1 and Intel Mac, and will look into this for you. Standby.


  1. We left this where you had installed the command-line tools for Xcode 11.4. These will not work in Big Sur, and you will need to install the command-line tools for Xcode 12.2 for Big Sur compatibility. This is for the homebrew (brew) package manager compilations.
  2. Once you have done [1], then from the Terminal, brew update, folllowed by brew upgrade. Homebrew will inform that is not yet compatible with Big Sur, but it will still upgrade your packages (e.g. ImageMagick).
  3. You will need to update your ~/.zshrc file to reflect changes to the ImageMagic version number in your MAGIC_HOME export.
  4. Open that Automator workflow in Automator on Big Sur, and resave it. See if it runs after all of the preceding changes [1-3] have been made.


20 replies
Question marked as Top-ranking reply

Nov 28, 2020 4:58 AM in response to VikingOSX

Are you attempting to run the Automator solution on the released Big Sur? I have Big Sur running on both an M1 and Intel Mac, and will look into this for you. Standby.


  1. We left this where you had installed the command-line tools for Xcode 11.4. These will not work in Big Sur, and you will need to install the command-line tools for Xcode 12.2 for Big Sur compatibility. This is for the homebrew (brew) package manager compilations.
  2. Once you have done [1], then from the Terminal, brew update, folllowed by brew upgrade. Homebrew will inform that is not yet compatible with Big Sur, but it will still upgrade your packages (e.g. ImageMagick).
  3. You will need to update your ~/.zshrc file to reflect changes to the ImageMagic version number in your MAGIC_HOME export.
  4. Open that Automator workflow in Automator on Big Sur, and resave it. See if it runs after all of the preceding changes [1-3] have been made.


Nov 28, 2020 4:33 PM in response to palnoch

All of the following was done on my 2014 MacBook Air running Big Sur 11.0.1.


  1. Installed Imagemagick 7.0.10-43
  2. Adjusted the MAGIC_HOME variable in my ~/.zshrc file to the 7.0.10-43 path
    • export MAGIC_HOME="/usr/local/Cellar/bin/imagemagick/7.0.10-43"
  1. Created a new Automator application with the same three actions and script contents as in the original.
  2. Reorganized the Test directory to your original hierarchy
  3. Ran the Automator application without issue


The individual MOCKUP folders gained a B.jpg that was 300 dpi at 25KB, just as in the original.


Nov 29, 2020 7:12 AM in response to palnoch

For step 1: In the Terminal, what is the result of:


brew list


and does imagemagick appear in that list? If it does, then:


brew upgrade imagemagick


As of 2020-11-29, that should install imagemagick version 7.0.10-44.


For step 2: By using brew, there is no apparent need for the MAGIC_HOME environment variable usage in the ~/.zshrc file, and it can be revised to:


export PATH="$HOME:/usr/local/bin:$PATH"


When you have edited the ~/.zshrc file and saved it, do the following from the Terminal command-line:


source ~/.zshrc


You should now be able to run the mogrify command on the command line.


As I mentioned previously, use Automator to open the Automator application you were using previously, and then simply save it again. That should update it for Big Sur. Try running it and assess the results.

Nov 29, 2020 11:49 AM in response to palnoch

In the Terminal, if you are running the Zsh shell, open the "dot" file:

open -e ~/.zshrc


or with Bash shell:

open -e ~/.bash_profile


Ensure that in the TextEdit's Format menu, the it is set make plain text, or no TextEdit toolbars are present:


If there is any code currently setting MAGIC_HOME, then remove that line, and in the line exporting PATH, set it too:

export PATH="$HOME:/usr/local/bin:$PATH"


Now, save the "dot" file, close the document, and exit TextEdit. From the Terminal again:

source ~/.zshrc

or

source ~/.bash_profile


Depending on the shell you are running. Now, open Automator, look for your Automator application that you have been using, and then open, and save it. Quick Automator, and run that Automator application again.


With imagemagick installed by homebrew, there are links to its binaries in that /usr/local/bin PATH reference.

Nov 29, 2020 1:06 AM in response to VikingOSX

Hi Viking,


Thanks so much for your time. I think I've updated XCode, I opened it and it upgraded and now it says this:

  1. I'm just stuck on these two steps: Once you have done [1], then from the Terminal, brew update, folllowed by brew upgrade. Homebrew will inform that is not yet compatible with Big Sur, but it will still upgrade your packages (e.g. ImageMagick).
  2. You will need to update your ~/.zshrc file to reflect changes to the ImageMagic version number in your MAGIC_HOME export.


Please help! Many thanks, Charlie P

Nov 29, 2020 8:59 AM in response to VikingOSX

Last login: Sun Nov 29 08:56:45 on console

charlie@charless-MacBook-Pro ~ % brew list


Traceback (most recent call last):

11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>'

10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative'

9: from /usr/local/Homebrew/Library/Homebrew/global.rb:37:in `<top (required)>'

8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'

6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>'

5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>'

4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'

3: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `version'

2: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:24:in `new'

1: from /usr/local/Homebrew/Library/Homebrew/os/mac/version.rb:26:in `initialize'

/usr/local/Homebrew/Library/Homebrew/version.rb:368:in `initialize': Version value must be a string; got a NilClass () (TypeError)

charlie@charless-MacBook-Pro ~ % 





















Nov 29, 2020 11:07 AM in response to VikingOSX

THANK YOU! Ok so the list showed ImageMagik and its upgraded. Now where do i do these steps:


For step 2: By using brew, there is no apparent need for the MAGIC_HOME environment variable usage in the ~/.zshrc file, and it can be revised to:


export PATH="$HOME:/usr/local/bin:$PATH"


When you have edited the ~/.zshrc file and saved it, do the following from the Terminal command-line:


source ~/.zshrc


You should now be able to run the mogrify command on the command line.


Many thanks

Dec 7, 2020 12:08 AM in response to VikingOSX

Hi Viking,


I have one slight issue. The new folders that I'm trying to apply the application too, are virtually the same, they still have the 'MOCKUPS' folder, however the individual files that I'm trying to montage are now labelled 1.jpg, 2.jpg all the way up to 9.jpg (before they were a letter)


How do I change the code to make it pick up the numbers instead of the letters? and how do I make the output montage file '10.jpg'? Here's the original code:


#!/bin/zsh


PARENT="${1:a}"

# JPEG quality

QUALITY=50

PPI=300

# so this script knows where the ImageMagick montage binary is located

source ~/.zshrc


# recursively get just the folders paths (F) in the parent directory

for adir in ${PARENT}/**/(F)

do

# only perform a montage on the contents of the mockups folder(s)

# and ignore any other folder or its contents

[[ ${adir%/} = ${PARENT} || ${adir:a:t:r:u} != "MOCKUPS" ]] && continue

montage ${adir}[l-t].jpg -geometry +3+3 -tile 3x3 -units PixelsPerInch -density ${PPI} \

-adjoin -strip -quality ${QUALITY} -background black ${adir}/B.jpg

done

exit





MANY THANKS

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.