Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

New Script: Text Substitutions/Code Replacements

Explorer ,
Nov 26, 2024 Nov 26, 2024

Hi all!

 

I wanted to share a script I've been working on - Text Substitutions! Inspired by PhotoMechanic's Code Replacements feature, this lets you add substitution [[targets]] to your metadata, and then have them replaced by any kind of text! About 50 substitutions are built in - letting you quickly swap in other metadata fields like the creation time, credit line, and location - and you can also create your own substitutions.

 

You can find the script on Adobe Exchange for $5/month, or for free in my bridge-scripts github repo (the two versions are identical). Detailed information about how to use the program and its various features can be found on the wiki.

 

This is still in development and it's based on my workflow, so if anyone has any suggestions I'd be happy to hear them out!

TOPICS
How to , Metadata , Scripting
400
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 14, 2025 Apr 14, 2025

Update - Version 1.1.0, Apr 2025

Large update for Text Substitutions introducing Functional Substitutions as well as multiple QoL updates. Download on GitHub.

Major Changes:

  • Added functional substitutions - these substitutions take parameters, calculate, and return a value. They are used the same way as normal substitutions; arguments are delimited with a semicolon.
    • fadd, f+
    • fsub, f-
    • fmul, f*
    • fdiv, f/
    • fmod, f%
    • ffloor
    • fceil
    • fround
    • fprefix, fpfx
    • fsuffix, fsfx
    • fsubstring, fsubstr
    • fequals, feq, f=
    • fnotequals, fneq,
...
Translate
Explorer ,
Nov 29, 2024 Nov 29, 2024

Update:

- Fixed a bug where built-in substitutions that printed the name of the month would be off by a month.

Re-download the script and install as normal!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 02, 2024 Dec 02, 2024

Update:

- Built-in substitutions that grab the date now grab it from the EXIF DateTimeOriginal field rather than the XMP DateCreated field. The EXIF field is the one that gets edited by the "Edit Capture Time" feature.

- Removed some debugging code that could pop up unnecessary alerts when using recursive substitutions.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 26, 2024 Dec 26, 2024

Update - Version 1.0.0, Dec 2024.

I've just released the first stable version for this script! Most of the code has been rewritten to make it more flexible and efficent, I've added several features to bring it closer to parity with PhotoMechanic, and I've also added another 2 dozen built-in substitutions. You can find the patchnotes here, or along with the download on Github.

 

  • Custom substitutions are now defined in a TSV format similar to photomechanic. See ts_customSubs.txt for info.
  • Removed old custom substitution input file format.
  • Added many new built-in substitutions for camera info and other stuff that was missing.
  • Added support for enumerated substitutions (multiple replacements for a single target)
  • Added a preferences pane with options for changing delimiters and whether to use the IPTC or EXIF date when getting the time. Also preferences for new features, version and script info, and stats on latest operation.
  • Added progress bar when processing over 20 files.
  • Substitutions are now checked recursively, meaning that they can be nested to any depth and evaluated inside-out.
  • Added substitutions/ts_photoMechanicVariables.txt - a file that aliases Photo Mechanic variable names to the builtin substitutions.
  • Rewrote the way substitutions are stored, making lookup multiple orders of magnitude faster, especially with large custom substitution lists - the operation is now O(1), meaning that looking up a substitution will take the same amount of time regardless of how large the list is.
  • More detailed error messages
  • Added checking for cyclical (infinite) recursion
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 02, 2025 Jan 02, 2025

Update - Jan. 2025:

This script is now availible on Adobe Exchange! It is up for an optional $5/month - if you don't want to pay you can download it directly from github. Even if you do pay, I'd recommend downloading it from github for the latest version as updates on Exchange need to get approved which can take several days.

 

https://exchange.adobe.com/apps/cc/202815/textsubstitutions-code-replacements-in-bridge

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 15, 2025 Jan 15, 2025

Update - Version 1.0.1, Jan 2024.

Bugfixes, reported by an user on Github Issues.

  • Reworked way versions are stored internally for better handling of new preferences
  • Fixed bug with prefs loading that would prevent the script from loading for new users.

Download on Github. The update has also been submitted to Adobe Exchange, though this will likely take a few days to approve.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 14, 2025 Apr 14, 2025
LATEST

Update - Version 1.1.0, Apr 2025

Large update for Text Substitutions introducing Functional Substitutions as well as multiple QoL updates. Download on GitHub.

Major Changes:

  • Added functional substitutions - these substitutions take parameters, calculate, and return a value. They are used the same way as normal substitutions; arguments are delimited with a semicolon.
    • fadd, f+
    • fsub, f-
    • fmul, f*
    • fdiv, f/
    • fmod, f%
    • ffloor
    • fceil
    • fround
    • fprefix, fpfx
    • fsuffix, fsfx
    • fsubstring, fsubstr
    • fequals, feq, f=
    • fnotequals, fneq, f!=
    • fgreaterthan, fgt, f>
    • flessthan, flt, f<
    • fgreaterequal, fgeq, f>=, f=>
    • flessequal, fleq, f<=, f=<
    • fOr, f||
    • fand, f&&
    • fnot, f!
    • fbranch, fbch
    • fsubstexists, fsubexists, fexists, fsex
    • fsafeexecute, fsafe
  • All free-text fields in Bridge's IPTC Core metadata section can now be checked for substitutions.
    • Added selector for what fields you want to be checked.
    • The file name can now be checked for substitutions
  • Added more builtin substitutions:
    • mFiletype, mExtension - returns the current file's extension
    • mRegion - aliased to mState
    • (empty substitution) - returns an empty string
    • mSource
    • mCaptionWriter, mDescWriter
    • mCopyrightNotice, mCopyright
    • mRightsUsageTerms, mUsageTerms
    • mJobIdentifier, mJobIdent, mJob
    • mInstructions
    • mCreator
    • mCreatorJob
    • mCreatorAddress
    • mCreatorCity
    • mCreatorState, mCreatorRegion, mCreatorProvince
    • mCreatorCountry
    • mCreatorPostalCode, mCreatorZip
    • mCreatorPhone
    • mCreatorEmail
    • mCreatorWebsite
  • New substitution file - ts_folderAssignments.txt - for automatically populating info based on the folder a file is in.
  • New substitution file - ts_hotCodes.txt - replicates PhotoMechanic's Hot Codes feature.

Minor Changes

  • Updated the Photo Mechanic Variables custom substitutions file with the new substitutions.
  • Typo in ts_customSubs.txt
  • Accurized error messages

 

Download on GitHub or from Adobe Exchange (will likely take a few days for the update to get approved).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2024 Dec 02, 2024

@dashz63429591 

 

Thank you for sharing, keep up the great work!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines