Update dg_prem_proj.bash#1
Conversation
1. Output was to folder where script was run, not where original `.prproj` was 2. Trash file with `-E` suffix left behind
| # replace the premiere version with "1" | ||
| printf "updating xml file... " | ||
| sed -i -E "s/\(<Project ObjectID.*Version=\"\).*\(\"\)/\11\2/" "$new_file" | ||
| sed -i "" "s/\(<Project ObjectID.*Version=\"\).*\(\"\)/\11\2/" "$new_file" |
There was a problem hiding this comment.
i think this addition would remove the backup in case something goes wrong, I'd rather leave that as-is so that someone doesn't potentially lose their entire project
There was a problem hiding this comment.
You can actually do something like
UNZIPPED=$(gunzip < $file)where $file is the file path. This just unpacks the project to a bash variable, which you can then pipe into sed.
Likewise, you can write the downgraded file like this:
echo "$MODIFIED" | gzip > ${file%.*}-downgraded.prprojwhich will basically write input-downgraded.prproj for any given input.prproj.
Wrap the whole thin in a
for file in "$@"
do
...
doneand you can insert the script into an Automator workflow plugin for Finder and perform the downgrade by just right clicking any prproj file and using a Quick Action.
Your implementation is a bit different from mine, but I came across yours after having made a similar utility here https://github.com/ocelotsloth/downgrade-premiere-prproj.
| printf "copying file... " | ||
| # make a copy of the file replace the extension with .gz | ||
| base=$(basename -- "$1") | ||
| dir=$(dirname $1) |
.prprojwas-Esuffix left behind