You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was quickly thrown together in half an hour for Nguyễn Quốc Hoàng.
How To Use
You will get prompted for a Source folder and a Destination folder.
These folders should contain files of the same file name.
The Source folder should have clips with Finder Tags.
The Destination folder should have clips with no Finder Tags.
This script copies those Finder tags from the Source to the Destination files.
Example Screenshots
Before
After
You can just copy the below code, paste it into the CommandPost Debug Console and press RETURN:
-- Get a the Source Folder Path:locallastSourceFolder=cp.config.get("tagCopier.LastSourceFolder", "")
localsourceFolder=hs.dialog.chooseFileOrFolder("Source Folder:", lastSourceFolder, false, true, false)
localsourceFolderPath=sourceFolderandsourceFolder["1"]
ifnotsourceFolderPaththenreturnendcp.config.set("tagCopier.LastSourceFolder", sourceFolderPath)
-- Get a the Destination Folder Path:locallastDestinationFolder=cp.config.get("tagCopier.LastDestinationFolder", "")
localdestinationFolder=hs.dialog.chooseFileOrFolder("Destination Folder:", lastDestinationFolder, false, true, false)
localdestinationFolderPath=destinationFolderanddestinationFolder["1"]
ifnotdestinationFolderPaththenreturnendcp.config.set("tagCopier.LastDestinationFolder", destinationFolderPath)
-- Get a table of Source Files:localsourceFiles=cp.tools.dirFiles(sourceFolderPath)
ifnotsourceFilesthenhs.dialog.blockAlert("Tag Copier Cancellled", "No source files could be detected.", "Cancel")
returnend-- Get a table of Destination Files:localdestinationFiles=cp.tools.dirFiles(destinationFolderPath)
ifnotdestinationFilesthenhs.dialog.blockAlert("Tag Copier Cancellled", "No destination files could be detected.", "Cancel")
returnend-- We'll store our Source File Tags in here:localsourceTags= {}
-- Save all our Source File Tags for future reference:for_, filenameinpairs(sourceFiles) doiffilename~="." andfilename~=".." thenlocalcurrentFile=sourceFolderPath.."/" ..filenamelocalcurrentTags=hs.fs.tagsGet(currentFile)
ifcurrentTagsthensourceTags[filename] =currentTagsendendend-- Count how many files we apply Tags too:localfileCount=0-- Apply our Source File Tags to any matching Destination Files:for_, filenameinpairs(destinationFiles) doiffilename~="." andfilename~=".." thenlocalcurrentFile=destinationFolderPath.."/" ..filenamelocalcurrentTags=sourceTags[filename]
ifcurrentTagsandtype(currentTags) =="table" thenhs.fs.tagsSet(currentFile, currentTags)
fileCount=fileCount+1endendend-- Show Competition Alert:hs.dialog.blockAlert("Tag Copier Complete!", "Tags were applied to " ..fileCount.." files.", "OK")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This was quickly thrown together in half an hour for Nguyễn Quốc Hoàng.
How To Use
You will get prompted for a Source folder and a Destination folder.
These folders should contain files of the same file name.
The Source folder should have clips with Finder Tags.
The Destination folder should have clips with no Finder Tags.
This script copies those Finder tags from the Source to the Destination files.
Example Screenshots
Before
After
You can just copy the below code, paste it into the CommandPost Debug Console and press RETURN:
For example:
Beta Was this translation helpful? Give feedback.
All reactions