I would like to merging 2 images into 1 with applescript.
currently i uses the following script, but it uses photoshop and it need to running as front window and not background process. which don't allow me to work on things i would like. is there a way i can do the same but doing it at background progress.
please email me back please.
tell application "Adobe Photoshop CS3"
activate
launch
set Template to open this_file
select all current document
copy
close current document without saving
end tell
set tempFolderName to "Send to Print"
tell application "Finder" to set snapFolder to ((desktop as string) & "Snap:")
set inputFolder to choose folder
tell application "Finder" to set SaveFolder to ((desktop as string) & "Snap:Original:")
tell application "Finder"
set filesList to files in inputFolder
if (not (exists folder ((snapFolder as string) & tempFolderName))) then
set outputFolder to make new folder at snapFolder with properties {name:tempFolderName}
else
set outputFolder to folder ((snapFolder as string) & tempFolderName)
end if
end tell
tell application "Adobe Photoshop CS3"
activate
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application "Finder"
-- The step below is important because the 'aFile' reference as returned by
-- Finder associates the file with Finder and not Photoshop. By converting
-- the reference below 'as alias', the reference used by 'open' will be
-- correctly handled by Photoshop rather than Finder.
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application "Adobe Photoshop CS3"
activate
open theFile
set docRef to the current document
set docHeight to height of docRef
set docWidth to width of docRef
-- Convert the document to a document mode that supports saving as jpeg
if (mode of docRef is not RGB) then
change mode docRef to RGB
end if
if (bits per channel of docRef is sixteen) then
set bits per channel of docRef to eight
end if
-- The first copy is simply saved with additional document info added
set infoRef to get info of docRef
set copyright notice of infoRef to "Copyright 2002-2007, Cool Photoshop Stuff"
set docName to name of docRef
set docBaseName to getBaseName(docName) of me
set fileIndex to fileIndex + 1
set newFileName to (SaveFolder as string) & docBaseName & "_" & fileIndex
save docRef in file newFileName as JPEG appending lowercase extension with copying
-- The second copy is saved resized to width of 100 pixels proportionally
-- There is no scale constraint in the resize image command.
-- Use the height/width ratio to simulate the option.
resize image current document width 3.35 height 2.09 resolution 300
paste
translate current layer of current document delta x inches 0 delta y inches 0.78
set fileIndex to fileIndex + 1
set newFileName to (outputFolder as string) & docBaseName & "_" & fileIndex
save docRef in file newFileName as JPEG appending lowercase extension with copying
-- The original document is closed without saving so it remains as it was
-- when opened for batch processing
close current document without saving
end tell
end repeat
tell application "Finder" to delete files in inputFolder