Hi
This is my problem: I use an Apollo audio interface from Universal Audio (UA). This interface has built in dsp, an I have a lot of different software emulation of famous EQ’s compressors and reverbs. From time to time UA update this software and I download a complete file of ALL the software, that runs on the interface. The only way to install the update is to run an installer that will flood my plug-ins folders with all the updated versions, which means that I to scroll through a lot of plug-ins that I doesn’t own to find the “few” that I actually own and need to use.
So I need a way to filter the plug-ins I own. I had contact with a friendly member of another forum, who created a “solution” that unfortunately no longer works. It’s an Automator runtime - is it called that?, which first uses the Ask For Finder Item to locate the folder where all my plug-ins are stored inside, and this script is executed:
#!/bin/zsh
: <<-COMMENT
Compare list of owned component names to names of all component files downloaded
into the current directory location. Using list intersection, apply a red tag to
each owned (common) file in the directory.
COMMENT
zmodload zsh/mapfile
function tag_file () {
osascript <<-AS
use framework "Foundation"
use AppleScript version "2.4"
use scripting additions
property NSURL : a reference to current application's NSURL
property NSURLTagNamesKey : a reference to current application's NSURLTagNamesKey
set taglist to {"${2}"}
set tURL to NSURL's fileURLWithPath:"${1}"
tURL's setResourceValue:taglist forKey:NSURLTagNamesKey |error|:(reference)
return
AS
}
# always present a full path to the script
FOLDER="${@:a:s/\~\//}"
OWNED="vst_owned.txt"
# use empty "" quotes to remove tags
TAGNAME="RED"
# create three regular arrays for components owned, all component names in the folder,
# and the intersection (common) component names to be tagged
typeset -a compown=() filelist=() tagged=()
# filename containing list of owned components
FNAME=${FOLDER}/${OWNED}
# read owned components names from FNAME text file into an array
compown=( "${(f)mapfile[$FNAME]}" )
# generate an array of installed components names where (/) only
# uses the folder names matching the UAD* pattern.
cd "${FOLDER}"
setopt kshglob
filelist=( UAD*.vst(/) )
# array intersection showing owned components whose folder names are to be tagged
tagged=( ${filelist:*compown} )
for f in ${tagged}
do
# any standard or custom tag name can be used here
tag_file "$f" $TAGNAME
done
exit 0
The text file: vst_owned.txt holds all the names of MY plug-ins and is used as a reference, and are placed in the folder with all the plug-ins.
The goal is to tag all the plug-ins that match a name from the file: vst_owned.txt with the tag red, so I can manually select all the plug-ins that have no tag and delete them.
But nothing happens! No files are tagged and the “funny” thing is, that if I have already tagged a file with red manually, the tag is deleted!!
I wish someone with experience in these matters would help me with this!
Regards Stig Christensen