Applescript und Photoshop

Liebe WWW-ler,

ich bin gerade dabei, mich etwas näher mit Applescript zu befassen.
Im speziellen möchte ich eine Ordneraktion schreiben, die, sobald eine Datei in den Ordner gelegt wird, Photoshop öffnet, die neue Datei öffnet und eine PS-Aktion startet.
Mein Hauptproblem ist die Ansteuerung dieser Aktion aus Applescript heraus.

Vielen Dank im Voraus
Alexander

PS: Mac OS 10.5, Photoshop CS4

Wäre das mit dem „Automator“ vielleicht nicht einfach zu bewerkstelligen? Im Übrigen würde ich es mit der Frage mal eher im Mac-Brett versuchen.

[MOD] Applescript und Photoshop
Hi ALexander

Hilse hat nicht ganz unrecht mit dem Tipp, es im Mac-Brett zu posten, obwohl Bildbearbeitungsprogramme eigentlich ursprünglich die Domäne der Apfel-Rechner waren.

Ich würde vorschlagen, deinen Artikel mal hier zu belassen, und wenn du keine zielführende Antworten bekommst, sag Bescheid, und ich verschiebe den Artikel ins Mac-Brett. OK?

Gruss
ExNicki

Hallo ExNicki

Deine Antwort ist mir ein Sternchen wert. So wünsche ich mir das von einem MOD.

Dank und Gruss
Heinz

Applescript und Photoshop - Bitte verschieben
Hallo MOD,

die Antworten sprudeln nicht gerade. ;-(
Wäre prima, wenn Du den Artikel verschieben könntest.

Gruß
Alex

Im speziellen möchte ich eine Ordneraktion schreiben, die,
sobald eine Datei in den Ordner gelegt wird, Photoshop öffnet,
die neue Datei öffnet und eine PS-Aktion startet.

Ich persönlich mag keine Ordneraktionen - IMHO instabil und lahm. Mit launchd gibt es aber bessere Alternative:
http://www.macosxhints.com/article.php?story=2008042…

Problem gelöst - Danke. (owT)
oT

Darf man an der Lösung teil haben, oder ist das ein Geheimnis?

Hallo Hilse,

nachdem das mit den Ordneraktionen wirklich unzuverlässig war, habe ich jetzt ein Skript als Programm gespeichert, mit dem ich die einzelnen Derivate erzeugen kann. Code s.u.

Gruß
Alex

set Ordner to (choose folder with prompt „Wählen Sie einen Ursprungsordner“) as string
set Wohinhigh to choose folder with prompt „Wählen Sie einen Zielordner für die 300 dpi/CMYK Jpegs“
set Wohinlow to choose folder with prompt „Wählen Sie einen Zielordner für die 72 dpi/RGB Jpegs“
set destPathhigh to Wohinhigh as string
tell application „System Events“
set these_files to every file of folder Ordner
end tell
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
tell application „Finder“ to set fileName to name of this_file
if (count of text items of fileName) is greater than 1 then
set AppleScript’s text item delimiters to „.“
– nimmt den „.“ als trenner des dateinamens
set fileName to text items 1 thru -2 of fileName
end if
set newFilePath to destPathhigh & fileName & „_300.jpg“
set this_info to info for this_file
if visible of this_info is true and alias of this_info is false then
tell application „Adobe Photoshop CS4“
launch
activate
try
open this_file showing dialogs never
end try
set meinBild to the current document
try
resize image meinBild resolution 300 resample method bicubic
end try
set myOptions to ¬
{class:JPEG save options, embed color profile:true, format options:stuck_out_tongue:rogressive, quality:12, scans:3} ¬

try
save current document in file newFilePath as JPEG with options ¬
myOptions appending no extension without copying
end try
close current document
end tell
end if
end repeat
set destPathlow to Wohinlow as string
repeat with i from 1 to the count of these_files
set this_file to (item i of these_files as alias)
tell application „Finder“ to set fileName to name of this_file
if (count of text items of fileName) is greater than 1 then
set AppleScript’s text item delimiters to „.“
– nimmt den „.“ als trenner des dateinamens
set fileName to text items 1 thru -2 of fileName
end if
set newFilePath to destPathlow & fileName & „_72.jpg“
set this_info to info for this_file
if visible of this_info is true and alias of this_info is false then
tell application „Adobe Photoshop CS4“
launch
activate
try
open this_file showing dialogs never
end try
set meinBild to the current document
try
change mode meinBild to RGB
resize image meinBild resolution 72 resample method bicubic
end try
set myOptions to ¬
{class:JPEG save options, embed color profile:true, format options:stuck_out_tongue:rogressive, quality:12, scans:3} ¬

try
save current document in file newFilePath as JPEG with options ¬
myOptions appending no extension without copying
end try
close current document
end tell
end if
end repeat