• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Asking for Photoshop Batch help please.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Asking for Photoshop Batch help please.


  • Subject: Re: Asking for Photoshop Batch help please.
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 01 Aug 2012 19:42:59 +1000

G'day

For posterity, this is what I ended up with...

on adding folder items to this_folder after receiving PhotoshopFiles
try
set ptd to path to desktop as text
--set ptdpp to ptd & "Photoshop Processing" as text
set ptdpp to this_folder as text
set ptdpif to ptd & "Processed Images Folder" as text
set ptdpsf to ptd & "Processed Stored Folder" as text
set fileToLog to (ptdpif) & ":Photoshop_Batch_Errors_Log.txt" as text
tell application "Finder"
if not (exists folder ptdpif) then
make new folder at folder ptd with properties {name:"Processed Images Folder"}
end if
if not (exists folder ptdpsf) then
make new folder at folder ptd with properties {name:"Processed Stored Folder"}
end if
if not (exists file fileToLog) then
make new file at folder ptdpif with properties {name:"Photoshop_Batch_Errors_Log.txt"}
end if
set PhotoshopFiles to files of folder ptdpp as alias list
end tell
say (count of PhotoshopFiles)
delay 4
tell application "Adobe Photoshop CS6"
activate
repeat with this_File in PhotoshopFiles
tell application "Finder"
set file_Name to name of this_File
set file_Extension to "psd" --default Save name extension of this_File
set file_Name2 to characters 1 through -((count of file_Extension) + 2) of file_Name as text
display dialog file_Extension
set file_to_save to (ptdpif & ":" & file_Name2 & "." & file_Extension as text)
set x to 1
repeat
if not (exists file file_to_save) then exit repeat
set file_to_save to (ptdpif & ":" & file_Name2 & " " & x & "." & file_Extension as text)
set x to x + 1
end repeat
end tell
open this_File
--set display dialogs to never
try
do action "Wood Frame - 50 pixel" from "Default Actions" without notifiers enabled and display dialogs -- < this particular action brings up a dialog box which can't be addressed with Applescript
save current document in file file_to_save with copying -- < set to 'without copying' if original files not required
on error errmsg
display dialog errmsg -- < write to ":Photoshop_Batch_Errors_Log.txt" here
end try
try
close document 1 saving no
end try
tell application "Finder"
set file_to_store to (ptdpsf & ":" & file_Name2 & "." & file_Extension as text)
set file_Extension to name extension of this_File
set x to 1
repeat
if not (exists file file_to_store) then exit repeat
set file_to_rename to (ptdpsf & ":" & file_Name2 & " " & x & "." & file_Extension as text)
if not (exists file file_to_rename) then
set name of file file_to_store to (file_Name2 & " " & x & "." & file_Extension as text)
exit repeat
end if
set x to x + 1
end repeat
try
move this_File to folder ptdpsf
on error
try
move this_File to folder ptdpsf with replacing
end try
end try
end tell
end repeat
end tell
on error errmsg
display dialog errmsg
end try


end adding folder items to
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Asking for Photoshop Batch help please.
      • From: "koenig.yvan" <email@hidden>
    • Re: Asking for Photoshop Batch help please.
      • From: Simon Topliss <email@hidden>
    • Re: Asking for Photoshop Batch help please.
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: AppleScript used as an outbox rules stop working after upgrade to ML
  • Next by Date: Re: Asking for Photoshop Batch help please.
  • Previous by thread: Re: AppleScript used as an outbox rules stop working after upgrade to ML
  • Next by thread: Re: Asking for Photoshop Batch help please.
  • Index(es):
    • Date
    • Thread