• 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: "koenig.yvan" <email@hidden>
  • Date: Wed, 01 Aug 2012 12:33:51 +0200


Le 01/08/2012 à 11:42, Brian Christmas <email@hidden> a écrit :

Hello

I would edit a bit as :

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


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 -- Finder

tell application "Adobe Photoshop CS6"
activate -- is it really useful ?
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
end tell -- Photoshop

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 -- Finder
end repeat


on error errmsg
display dialog errmsg
end try


end adding folder items to


I'm puzzled by a detail.
If you know that the original files are PSDs, why are you rebuilding the name with long instructions ?
set file_to_save to (ptdpif & ":" & file_Name)
set file_to_save to (ptdpif & ":" & file_Name2 & " " & x & ".psd")
set file_to_rename to (ptdpsf & ":" & file_Name2 & " " & x & ".psd")
set name of file file_to_store to (file_Name2 & " " & x & ".psd")
would be sufficient.

I'm annoyed by a design choice. 

If it exists, in the folder ptdpsf, a file with the name of the new file to add, you rename the existing file.
From my point of view, it would be better to change the name of the added file.


Yvan KOENIG (VALLAURIS, France) mercredi 1 août 2012 12:33:34


 _______________________________________________
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: Brian Christmas <email@hidden>
References: 
 >Re: Asking for Photoshop Batch help please. (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Asking for Photoshop Batch help please.
  • Next by Date: Re: Asking for Photoshop Batch help please.
  • Previous by thread: Re: Asking for Photoshop Batch help please.
  • Next by thread: Re: Asking for Photoshop Batch help please.
  • Index(es):
    • Date
    • Thread