Photoshop files keywords
Posted: 03 Oct 2021 05:17
Can XYplorer see, show and search by keywords in psd files ? Import and convert them into its own tags ?
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Into XYplorer's tag database? Sure, but again, only via scriptingImport and convert them into its own tags ?
Code: Select all
$app = "D:\Tools\@Command Line Tools\exiftool\exiftool.exe";
$desc = trim(runret("""$app"" -s -s -s -description ""<curitem>"""), <crlf>, "R");
tagitems("tags", $desc, <curitem>);
Code: Select all
$app = "D:\Tools\@Command Line Tools\exiftool\exiftool.exe";
end (exists($app) != 1), quote($app) . <crlf 2> . "not found, aborted!";
// Get the "Description" and the "Exif image width"
$properties = <<<>>>
description
exifimagewidth
>>>;
$properties = trim($properties, <crlf>);
$cntProperties = gettoken($properties, "count", <crlf>);
end (!$properties), "No properties defined, aborted!";
// Join properties
$propSingle = "";
$propFormatted = "";
foreach($property, $properties, <crlf>, "e") {
$propSingle .= " -" . $property;
$propFormatted .= "<:>${" . $property . "}";
}
// Put them together for the exif command
$cmd = <<<>>>
-q $propSingle -p "${directory;s(/)(\\)g}$filename$propFormatted" "<curpath>"
>>>;
// Run it and do the tagging
$lines = trim(runret("""$app"" $cmd"), <crlf>, "R");
$cntLines = gettoken($lines, "count", <crlf>);
while ($i++ < $cntLines) {
$line = gettoken($lines, $i, <crlf>);
$file = gettoken($line, 1, "<:>", "t");
// If something went wrong and the output doesn't contain a file
if (exists($file) != 1) { continue; }
// Use a loop here
// It would allow to do the tagging via "ex" columns a bit easier
$tags = "";
$j = 0;
while ($j++ < $cntProperties) {
$tag = gettoken($line, $j + 1, "<:>", "t");
$tags .= $tag . ",";
}
$tags = formatlist($tags, "esd", ",");
if ($tags) { tagitems("tags", $tags, $file); }
}
So rename exiftool^^ And if the tag is empty afterwards, your file doesn't have that description property^^The stand-alone Windows executable does not require Perl. Just download and un-zip the archive then double-click on "exiftool(-k).exe" to read the application documentation, drag-and-drop files and folders to view meta information, or rename to "exiftool.exe" for command-line use. Runs on all versions of Windows.
exiftool "path and file you've tried it with"