メタデータを利用してインデザインを開かずに、リンクパスを調べる。
インデザインファイルをExifToolで調べると
いろんな情報が含まれている訳ですが、
今回は、リンクファイルのパスを調べてみました。
ほとんど検証してないので、
使用する際は、ご注意ください。
おそらくCS5、CS6のインデザインファイルで使用可能です。
これを上手く発展させていけば、
インデザイン、イラストレーターを開かずに、
リンクファイルを収集できるかも知れません。
【作成方法】
ユーティリティ > AppleScript エディタを起動。
下記のAppleScriptコードを入力して、
アプリケーション形式で「indd_LinkPath_List」などの適当な名前で保存。
▼AppleScript(ドラッグ&ドロップタイプ)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
on open dorp set fileLinkList to {} repeat with dorpFile in dorp try set theFilePath to dorpFile as string set POSIXpath to quoted form of POSIX path of dorpFile set Separation to "----------------------------------------------" set XMPtext to do shell script "sed -n '/xmpMM:Ingredients/=' " & POSIXpath if XMPtext ≠ "" then set inddName to name of (info for dorpFile) set XMPtextCount2 to count paragraphs of XMPtext set XMPtextCount1 to XMPtextCount2 - 1 set paragraph1 to XMPtextCount1 set paragraph2 to XMPtextCount2 set T1 to paragraph paragraph1 of XMPtext set T2 to paragraph paragraph2 of XMPtext try set swatchNameTEXT0 to do shell script "echo | sed -n -e '" & T1 & ", " & T2 & "s/^.*<stRef:filePath>\\(.*\\)<\\/stRef:filePath>/\\1/p' " & POSIXpath set swatchNameTEXT to (my decodeURL(swatchNameTEXT0)) as Unicode text set swatchNameTEXT to repChar(swatchNameTEXT, ",", return) of me set swatchNameTEXT to repChar(swatchNameTEXT, "file://", "") of me end try else set swatchNameTEXT to "No info" end if set the end of fileLinkList to return & inddName & return & Separation & return & swatchNameTEXT & return & return end try end repeat BeepVolume() of me if fileLinkList ≠ {} then tell application "TextEdit" activate set text of (make new document) to (fileLinkList as text) end tell else activate display dialog "No info" end if end open --文字置換ルーチン on repChar(origText, targStr, repStr) set {txdl, AppleScript's text item delimiters} to {AppleScript's text item delimiters, targStr} set temp to text items of origText set AppleScript's text item delimiters to repStr set res to temp as text set AppleScript's text item delimiters to txdl return res end repChar on BeepVolume() set getvolume to get volume settings set outVol to output volume of getvolume set myVol to outVol / (100 / 7) set volume 0.7 beep 1 delay 0.5 beep 1 set volume myVol end BeepVolume on decodeURL(str) set scpt to "php -r 'echo urldecode(\"" & str & "\");'" return do shell script scpt end decodeURL |
【使い方】
作成したスクリプトに調べたいインデザインファイルを
ドラッグ&ドロップすると下図のように表示されます。
参考情報
Webで利用される様々な文字列エンコードを扱うためのAppleScriptいろいろ