I have created a plugin that can batch relink multiple files that have the same file name except one difference which i can input and it works great. Only thing is I want the plugin to also rename the clips in premiere to match the new file that it has linked to. I am using AI for the code as I am in no way a coder and it cannot get the renaming to work. Even trying a new plugin which its only function is to rename a clip can’t do it. The AI seems to suggest its not possible. Does anyone know if this is the case? It feels like renaming a clip should be such a simple thing to be able to do. I will paste the summary the AI has given me as to why this is not possible. Thanks. Complete Summary: All Methods Exhausted
Using AI to generate reliable code with premiere will be tricky as of now - since it need to rely on detailed documentation and existing samples.
… which are lacking / incomplete, so likely not enough info for AI
You need to
Get the ProjectItem object
Lock the UI ( lockedAccess)
executeTransaction
createSetNameAction
On the compondAction argument of the executeTransaction, add the newly created action
( Per docs, it seems like both ProjectItem and ClipProjectItem both implement createSetNameAction, if it fails you may have to cast the ProjectItem to ClipProjectItem before calling createSetNameAction).
Check for other thread on the forum for the proper syntax on how execute an action.
So while this does now rename in the project panel I have realised that the clips are not renamed on the timeline in a sequence. So I end up with correctly named and relinked files in the project panel but correctly linked but incorrectly named files on the timeline. Again many attempts to get this plugin to also rename the clips on the time line have failed. Any advice? Would be much appreciated. This is what has been attempted so far:
When created, trackItems take on the name of their source projectItem. No link is maintained after that; trackItems can be renamed, independently of their parent.
One possible approach to renaming a projectItemand all its “children”:
for each Sequence in Project:
for each Track in Sequence:
for each trackItem:
if trackItem.parent == (The projectItem I care about): // rename the trackItem, to match the projectItem