Deleting variables created n "Set Value of Variables"

Sometimes I use Automator but today I wanted to create something more ambitious using “Set Value of Variables” action. Not only my workflow is not good enough but I also created a bunch of variables that I have no idea how to get rid of. I tried right n left click and use delete button(s) - nothing, I tried to google solutions but with no luck. There may be an easy solution or some other way to do it manually but … In the screenshot you can see what I need to delete. Any help appreciated.

I’m using OS Monterey if that is of any relevance…

In the View menu, is there a ‘Variables’ item?

Or do you have a ‘log’ pane at the bottom of the main window? If so, there may be an icon/button (on the bottom status bar) that looks like two stacked rectangles, which you can click on to switch views to show the available variables and from there, you should be able to right-click and delete.

1 Like

Oh, man. You’re correct! At the bottom I can see the ‘log’ pane where custom-created variables are visible. Right-click allows me to choose to edit or delete. Not quite Apple-intuitive approach but at least I know what to do. Appreciate it! :slight_smile:

1 Like

I had the same problem when I first began using Automator. It took me a while to figure out how to even use variables as there isn’t a lot of documentation that I found helpful.

For simple tasks, Automator is fairly easy to understand and follow.
However, I tried to do the following within one workflow:

  1. Create folder “JPG”
  2. Copy files from folder “ORIG” to “JPG”
  3. Convert file type of copied files to jpg’s.

I know there is a simpler way to convert files in a folder leaving originals but I thought of learning something new….

At first, I tried just creating a folder but then the workflow stopped saying it can’t see the new folder….

Anyway, I googled a bit and saw some people wrote about using custom variables. And yes, me to find any documentation has been a failure :joy:

For your image workflow, try duplicating the image before converting.

That’s how I have been doing so far. Manually moving or duplicating originals. This time however, I thought of upgrading my workflow and creating more intelligent version.
The steps posted above. :slight_smile:
Maybe one day I manage to do it… otherwise I create a script in python.

I mean, use the ‘duplicate finder items’ action in automator. Then convert the result of that. You end up with the original file in its original state, and the duplicate which is now a jpeg (or whatever you converted it to). Let automator do the work.

Yeah, I think I used this option also.
But again, I challenged myself to create a workflow that creates a separate folder and there creates jpg’s so I don’t have all files in the same folder.

Create a new workflow and add these actions with these settings

  1. new folder (name: ‘desto’, where: ‘desktop’)

  2. Get specified finder items (add the source folder which contains the target images; right-click the action and select ‘ignore input’)

  3. get folder contents
    results: list of images in above added folder

  4. duplicate finder items
    results: list of file urls for above images, each with ‘%20copy’ appended to name

  5. change type of images (to type PNG)
    results: list of above images converted to png, with ’ copy’ appended to name

  6. rename finder items: replace text (find ’ copy’ in basename only)
    results: list of above png images without ’ copy’ in name

  7. move finder items (to ‘desto’)
    results: list of above png images, now in ‘desto’ folder

If you wish to manage which images in the source folder are converted and moved, you could insert the Filter Finder Items action above the Duplicate Finder Items action however, I find that it is flaky — at least with image types. For example, when filtering based on the file label (eg Green), it works fine, but when filtering based on kind (eg image, or other:JPEG image), it fails. YMMV.

The OP wants to learn more about the operation of Automator, and Mockman has helped him with that.

The Shortcuts app may replace Automator at some point, and it is available on macOS Monterey. So, FWIW, I wrote a shortcut that will do what the OP wants.

Copy and Change Format.shortcut (22.9 KB)

Hi, man.
Thank you for the shortcut code.
Honestly, I have used it a couple of times on my iPhone and failed to realise it’s available on my machine.
I’ll give it a go.