Welcome Guest

Pages: 1
Artwork Description Action
Gary-SwiftPostJune 1, 2024, 08:48
Beginner
Posts: 28
Registered:
April 29, 2014, 06:12
Normal topicArtwork Description Action

A similar question was previously asked here, but I don't see a solution.

I would like to be able to test if the Artwork Description field has a given value and, if so, change the value.

Can this be done via an action?

2MR2PostJune 1, 2024, 10:18
Avatar photo
Administrator
Posts: 2152
Registered:
August 23, 2012, 19:27
Normal topicArtwork Description Action

This can be done in two statements. In both cases the statement is Indexed Artwork.

Get index of artwork item matching description "test" to Variable 0
Set description of artwork item[\v0] to "Hello", per file index

The first statement returns the index of the first artwork item to match some text. (In this case 'test'). The matched index is returned in track variable 0. If there is no match for a particular file, the variable is set to -1.

The second statement sets sets the description field of the artwork item at the index in per file track variable 0. Note if the index is -1 it is invalid and ignored. In this sample, the description is set to 'Hello'. Note that per file must be specified as the track variable can have a different value in each file.

Note that the search is always case insensitive and that as escape sequences can be specified in the text fields, they can be set at runtime. So the following could be done:

Prompt for Text save to named variable 'pattern', "Enter the pattern:"
Prompt for Text save to named variable 'replacement', "Replace the pattern with:"
Get index of artwork item matching description "\<pattern>" to Variable 0
Set description of artwork item[\v0] to "\<replacement>", per file index

2MR2PostJune 1, 2024, 10:24
Avatar photo
Administrator
Posts: 2152
Registered:
August 23, 2012, 19:27
Normal topicArtwork Description Action

Sorry, I meant to upload the sample:

https://2manyrobots.com/actions/Replace-Artwork-Description-Field.zip

Gary-SwiftPostJune 2, 2024, 09:09
Beginner
Posts: 28
Registered:
April 29, 2014, 06:12
Normal topicArtwork Description Action

Brilliant, thank you very much. Much appreciated!

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