Skip to content

Update dg_prem_proj.bash#1

Open
dzg wants to merge 1 commit into
jdrub:masterfrom
dzg:patch-1
Open

Update dg_prem_proj.bash#1
dzg wants to merge 1 commit into
jdrub:masterfrom
dzg:patch-1

Conversation

@dzg

@dzg dzg commented Mar 31, 2020

Copy link
Copy Markdown
  1. Output was to folder where script was run, not where original .prproj was
  2. Trash file with -E suffix left behind

1. Output was to folder where script was run, not where original `.prproj` was
2. Trash file with `-E` suffix left behind
Comment thread dg_prem_proj.bash
# 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"

@jdrub jdrub Mar 31, 2020

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.prproj

which will basically write input-downgraded.prproj for any given input.prproj.

Wrap the whole thin in a

for file in "$@"
do
        ...
done

and 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.

Comment thread dg_prem_proj.bash
printf "copying file... "
# make a copy of the file replace the extension with .gz
base=$(basename -- "$1")
dir=$(dirname $1)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants