0

現在のドキュメントのすべてのレイヤーの名前を置き換えることができますが、「名前が終わる場所」を渡すと失敗し、例外は貴重なフィードバックを提供しません。

tell application "Adobe Photoshop CS3"
tell current document
    set name of every layer where name ends with "copy*" to "replace_using_sed"
end tell

終わりを告げる

エラーを見つけることができますか、それとも別の方法を知っていますか?

4

2 に答える 2

0

これでスクリプト全体が修正されるかどうかはわかりませんが、「whose」フィルターと呼ばれます...したがって、「where」という単語を「whose」に置き換えます。誰のフィルターがフォトショップで機能するかを言っているわけではありませんが、試してみることができます。それが機能しない場合は、すべてのレイヤーを取得し、繰り返しループでそれらをループし、各名前を1つずつフィルタリングする必要があります。

于 2011-02-16T15:57:00.283 に答える
0

がエラーのcopy*原因です。*AppleScript ではワイルドカードとして使用できません。代わりに、を使用して... where name contains "copy" ...ください。

これがあなたのスクリプトの私の作業バージョンです(Photoshop CS5でテスト済み):

tell application "Adobe Photoshop CS3"
    set layerList to name of every layer in current document where name contains "copy"
end tell

repeat with currentName in layerList
    set layerName to text 1 thru ((offset of "copy" in currentName) - 1) of currentName
    tell application "Adobe Photoshop CS3"
        set (the name of first layer in current document where name contains "copy") to layerName
    end tell
end repeat
于 2011-02-16T16:20:17.420 に答える