Welcome Guest

Pages: 1
Scan each file and stop and alert if any files has more than one artwork item (artwork count))
Gary-SwiftPostOctober 24, 2026, 11:35
Advanced
Posts: 78
Registered:
April 29, 2014, 06:12
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

I want to create an action that will show an alert if a file has multiple artwork items.

Something like the action below but replace "Test if artwork does not exist" with an artwork count statement.

This action also switches to to the Artwork panel after the prompt.

Set named variable 'search' to empty
' ToDo - Scan each file and stop and alert if any files has more than one artwork item
Test if artwork does not exist
if true
    Prompt "Multiple artwork items found on ***!"
    Set named variable 'search' to "#Edit Panel↵…"
endif
# Test if named variable 'search' is equal to named variable 'search' (Set test state)
Test if named variable 'search' is not empty (Set test state)
if true
    ' Go to edit ‘Artwork’ edit panel if named var ‘search’ is not empty.
    Stop Action and Post Process with the contents of named variable 'search'
endif
Gary-SwiftPostOctober 24, 2026, 12:28
Advanced
Posts: 78
Registered:
April 29, 2014, 06:12
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

I think I figured it out. It seems to work anyway. I'm happy to hear any advice regarding this.

' Scan each file and stop and alert if any files has more than one artwork item
' Init the panel switch var
Set named variable 'search' to empty
Save per file artwork count -> Variable 0
Test if the integer value of the Variable 0 field > "1" (Set test state)
if true
    Set named variable 'artist_album_name' to "\[Album Artist] - \[Album]"
    Prompt "Multiple artwork items found on:↵…"
    Set named variable 'search' to "#Edit Panel↵…"
endif
# Test if named variable 'search' is equal to named variable 'search' (Set test state)
Test if named variable 'search' is not empty (Set test state)
if true
    ' Go to edit ‘Artwork’ edit panel if named var ‘search’ is not empty.
    Stop Action and Post Process with the contents of named variable 'search'
endif
2MR2PostOctober 24, 2026, 13:23
Avatar photo
Administrator
Posts: 2502
Registered:
August 23, 2012, 19:27
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

Oops I seem to have lost my reply. It looks like yours will work ... at least for a single album at a time. I wrote a variant which uses two tiny chained actions and a main window filter. It will change the edit panel but it will also select all files which have more than one artwork item.

download https://2manyrobots.com/actions/Report-if-More-than-One-Artwork-Item.zip

Run the action named Report if More than One Artwork Item

Gary-SwiftPostOctober 25, 2026, 06:20
Advanced
Posts: 78
Registered:
April 29, 2014, 06:12
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

Yes, that's brilliant. Yours works exactly as described.

I wasn't even sure if I wanted this to work in batches but after using it, I think this is great feature to have.

I've added your version to my auto run on save script (PART 1).

Do you perceive any downside to that?

Version 1.0 - The second part of this action only runs if all loaded files are in the same folder

' PART 1
Run action 'Report if More than One Artwork Item - Part 2'
' PART 2
' Change the set of active files to include all loaded files
Expand Execution to Unselected Files
' Test if all loaded files are in the same folder
Get Property Path to Folder -> Variable 0
Test if Variable 0 is the same in every file, Set result
if true
    ' At this point all files in the single folder are active ... even if one or more of them was not prior to starting the action.
    
    ' Test if the artwork exists and resize if bigger than 1200x (Includes confirmation prompt)
    Run action 'Artwork Converter'
    
    Run action 'Save folder.jpg (if necessary) - efficient'
    
    ' Possibly run other actions
    # Run action 'Artwork to folder icon (On save)'
    Run action 'Clean Metadata (On Save)'
    
endif


Gary-SwiftPostOctober 25, 2026, 08:49
Advanced
Posts: 78
Registered:
April 29, 2014, 06:12
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

Actually, your action doesn't work so well with a single album loaded. (It always triggers the prompt.)

However, my "Auto run on save" action includes some logic to detect if all files come from different folders.

I've adjusted the logic to only run your script when there are multiple albums added and this seems to work fine.

' RUN FOR SINGLE ALBUM
' Change the set of active files to include all loaded files
Expand Execution to Unselected Files
' Test if all loaded files are in the same folder
Get Property Path to Folder -> Variable 0
Test if Variable 0 is the same in every file, Set result
' This part only runs if all loaded files are in the same folder
if true
    ' At this point all files in the single folder are active ... even if one or more of them was not prior to starting the action.
    
    ' Test if the artwork exists and resize if bigger than 1200x (Includes confirmation prompt)
    Run action 'Artwork Converter'
    
    Run action 'Save folder.jpg (if necessary) - efficient'
    
    ' Run other actions
    
    ' Remove unwanted metadata
    Run action 'Clean Metadata (On Save)'
    
    ' Extra artwork check
    Run action 'Check for Extra Artwork (On Save)'
else
    ' RUN FOR MULTIPLE ALBUMS
    Run action 'Report if More than One Artwork Item - Part 2'
endif

2MR2PostOctober 25, 2026, 09:01
Avatar photo
Administrator
Posts: 2502
Registered:
August 23, 2012, 19:27
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

Hmmm.... not sure what's not working for you. Both actions I sent ignore folders completely and look at individual files. What prompt is triggering and when? The filter will identify all loaded files which have more than one artwork item ... even if they were not initially selected. I felt that this was benign but perhaps it wasn't for you. It's easy to change by simply setting a track variable to some non zero value and having the filter test for that instead.

Regardless, your implementation seems fine with the exception that nothing will be done if more than one folder is loaded. I can't see all the nuances but it looks good.

Gary-SwiftPostOctober 25, 2026, 13:20
Advanced
Posts: 78
Registered:
April 29, 2014, 06:12
Normal topicScan each file and stop and alert if any files has more than one artwork item (artwork count))

It's all good, thank you. I appreciate your help.

It's doing exactly what I wanted now.

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.019 seconds.