Make EA search through Adobe CC folders to find plugins

jwojda
Valued Contributor II

I have an EA that looks for specific location (in it's current form InDesign 2020), but to simplify, I'd like to have it just look through all adobe InD version folders (and if it can even relate what version of the plugin it corresponds to (2019, 2018, 2020, etc)

#!/bin/sh

RESULT="Not Installed"

for i in /Applications/Adobe InDesign 2020/Plug-Ins/DemandTec.InDesignPlugin; do

  if [[ $? -eq 0 ]]; then
    RESULT=$(/usr/bin/defaults read /Applications/Adobe InDesign 2020/Plug-Ins/DemandTec.InDesignPlugin/Versions/A/Resources/Info.plist CFBundleShortVersionString)
  fi
done
/bin/echo "<result>$RESULT</result>"
1 REPLY 1

Mauricio
Contributor III

@jwojda I've created a dummy set of folders to represent the Adobe InDesign 2020, Adobe InDesign 2021 with a Plug-Ins... subfolders.
Have a try on this regex and see if fits your needs.

#!/bin/sh

RESULT="Not Installed"

for i in /Applications/Adobe InDesign 20[0-9][0-9]/Plug-Ins/DemandTec.InDesignPlugin; do
    RESULT=$(/usr/bin/defaults read "$i/Versions/A/Resources/Info.plist" CFBundleShortVersionString)
done
/bin/echo "<result>$RESULT</result>"

What would happen if you have more than one version of the 'DemandTec.InDesignPlugin' installed?

Do you need all versions listed?

Regards,