Script to rebuild All Images / broken links
Commonly need to move subfolders after capture, rename, etc and deal with broken links. Have been working on a script that will refresh the favorites list as well as re-populate the "All Images" smart album but I'm getting stuck. I've given up on fixing "All Images" and am looking to create an ad-hoc album "Temp All Images" but I'm assuming this will have to be periodically updated.
Current pieces:
Thanks for any insights you can offer.
Current pieces:
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
set theRules to "<?xml version="1.0" encoding="UTF-8"?><MatchOperator Kind="AND"></MatchOperator>"
tell application "Capture One 20.13.1.0"
set theDocument to the first document
tell theDocument
delete (every collection whose kind is favorite and user is true)
delete (every collection whose name is "Temp All Images")
set newAlbum to make new collection with properties {name:"Temp All Images", kind:album, rules:theRules}
end tell
set documentFolderPath to folder of current document as text
set CaptureFolder to documentFolderPath & "Capture:"
set CaptureFolderPath to CaptureFolder as alias
set folderList to {}
try
tell application "Finder"
set folderList to name of every folder of entire contents of CaptureFolderPath
--set RUSHfolderList to name of every folder of entire contents of RUSHFolder
end tell
end try
set SKUList to {}
if (count of folderList) > 0 then
repeat with j from 1 to count of folderList
set ThisFolder to item j of folderList
if (ThisFolder is not in SKUList) then --and (character 1 of ThisFolder is not "_") then
if (character 1 of ThisFolder is not "_") and (character 1 of ThisFolder is not "z") then
copy ThisFolder to end of SKUList --as text
set ThisFolderPath to CaptureFolder & ThisFolder & ":" as text
tell theDocument
make new collection with properties {kind:favorite, file:ThisFolderPath}
add inside newAlbum variants every variant of ThisFolder
end tell
end if
end if
end repeat
end if
end tell
Thanks for any insights you can offer.
0
Post ist für Kommentare geschlossen.
Kommentare
0 Kommentare