Hi all
Whenever I paste the following string by copy/paste manually into the keywords field:
Photoshop CS converts it to:
(wanted result)
(simply close the file info panel after pasting and reopen it)
BUT!
If I do this with AppleScript Photoshop converts it to:
““Büro”” ““Computer”” ““Frau”” ““Geschäftsmann”” ““innen”” ““Laptop”” ““Manager”” ““Mann”” ““Notebook”” ““Schreibtisch”” ““Buero”” ““Geschaeftsmann””
Strange somehow…
Does anyone know how to format the string in AppleScript so we get the result we want?
I know that this is not strict IPTC-NAA 4.1. If we follow the specification exactly:
will not be converted by Photoshop. It results in:
Script for testing:
property _stichwoerter_format : 1
set _temp to "Büro; Computer; Frau; Geschäftsmann; innen; Laptop; Manager; Mann; Notebook; Schreibtisch; Buero; Geschaeftsmann"
if last character of _temp is " " then set _temp to (characters 1 thru -2 of _temp) as Unicode text
if _stichwoerter_format = 0 then
set _temp to _SaR(_temp, "; ", " ")
else if _stichwoerter_format = 1 then
set _temp to _SaR(_temp, "; ", "\" \"") -- <- This is the crux!
set _temp to "\"" & _temp & "\""
end if
tell application "Adobe Photoshop CS"
tell document 1
tell info
set keywords to _temp
end tell
end tell
end tell
return _temp
-- Suchen und Ersetzen
on _SaR(_text, _search, _replace)
set AppleScript's text item delimiters to _search
set _text to every text item of _text
set AppleScript's text item delimiters to _replace
set _text to _text as string
set AppleScript's text item delimiters to ""
return _text
end _SaR
Any help is appreciated! Thanks in advance!
Thomas