Current position:  Home > Default > Photoshop Overwrite exisiting file

Photoshop Overwrite exisiting file

Time:November 30
Advertisement
I'm using this line to write over an exisiting document if it exists already
  save in (localBrandFolder_PSD) as Photoshop format with options myPSDOptions without copying
This doesn't give the expected behaviour.
Previously on other applescript I have used it in this was
save in (localBrandFolder_High_Res & name) as JPEG with options myOptions with replacing
As you can see in this script it turns green and hence won't work.
Any pointers please
Mat
Advertisement
This might help, this is the beginning of the script.
property type_list : {"8BPS"}
property extension_list : {"psd"}
script o
          property theseNames : {}
end script
-- empty log file
do shell script "echo  'Files not processed in Photoshop :'  > ~/Desktop/LogPhotoshopError.txt"
set noError to true
--Setup list of folders and process details of folders
set dtF to paragraphs of (do shell script "ls -F ~/Desktop | grep '/' | cut -d'/' -f1")
set tc to (count dtF)
repeat with i from 1 to tc
          set folderName to item i of dtF --<:  is the folder name, no need to use text item delimiters -->":"
          if folderName does not start with "2_" and folderName does not start with "Hot" and folderName does not start with "Press" and folderName does not start with "Design" then
                    set {oldTID, my text item delimiters} to {my text item delimiters, "_WK"}
                    set FolderEndName to last text item of folderName
                    set brandName to first text item of folderName
                    set my text item delimiters to "_PSD"
                    set weekNumber to first text item of FolderEndName
                    set my text item delimiters to oldTID
                    set theFolder to ("Hal 9000:Users:matthew:Desktop:" & folderName)
  --set up names to destination folders and create locally based on brand name and week number
                    set this_local_folder to "Hal 9000:Users:matthew:Pictures:2011-2012"
                    set localWeekFolder to my getFolderPath("WK" & weekNumber, this_local_folder)
                    set localBrandFolder to my getFolderPath(brandName, localWeekFolder)
                    set localBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", localBrandFolder)
                    set localBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", localBrandFolder)
                    set localBrandFolder_PSD to my getFolderPath(brandName & "_WK" & weekNumber & "_PSD", localBrandFolder)
                    set this_Network_folder to "DCKGEN:Brands:Zoom:Brand - Zoom:Upload Photos:2012:"
                    set networkWeekFolder to my getFolderPath("Week" & weekNumber, this_Network_folder)
                    set networkBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", networkWeekFolder)
                    set website_images to "DCKGEN:Website_Images:"
  --set up names to destination folders and create over Netwrok for FTP collection (based on a mounted drive)
                    set this_ftp_folder to "Impulse:"
                    set ftpWeekFolder to my getFolderPath("Week" & weekNumber, this_ftp_folder)
                    set ftpBrandFolder to my getFolderPath(brandName, ftpWeekFolder)
                    set ftpBrandFolder_Low_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_LR", ftpBrandFolder)
                    set ftpBrandFolder_High_Res to my getFolderPath(brandName & "_WK" & weekNumber & "_HR", ftpBrandFolder)
  --taking the folder identify which process it must follow.
                    if brandName is equal to "Matt" then
                              try
                                        tell application "Finder" to set o's theseNames to (name of files of alias theFolder whose file type is in the type_list or name extension is in the extension_list)
                              on error
                                        set o's theseNames to {} -- no psd files or "8BPS"
                              end try
                              set numOfNames to (count o's theseNames)
                              repeat with j from 1 to numOfNames
                                        set thefile to theFolder & ":" & (item j of o's theseNames)
  --    M a t t    Folder Photoshop Process
                                        tell application "Adobe Photoshop CS6"
  -- I remove the command activate, Photoshop stay in background
                                                  try
  open (alias thefile) showing dialogs never
                                                            set myOptions to {class:JPEG save options, quality:12}
                                                            set myPSDOptions to {class:Photoshop save options, embed color profile:true, save layers:true}
                                                            tell current document
  --If the quick mask mode has been left on then delete the channel Quick Mask
                                                                      if (quick mask mode) then delete channel ¬
                                                                                "Quick Mask"
  --If the Layer is incorrectly labeled with Original Layer it needs renaming to original Image
                                                                      if (exists layer "Original Layer") then ¬
                                                                                tell layer "Original Layer" to set name to "Original Image"
  save in (localBrandFolder_PSD) as Photoshop format with options myPSDOptions without copying
                                                                      (delete layer "Original Image") flatten
Read related articles
Overwrite Exisiting Files - error
How to save for web AND overwrite original files with Action?
Could not initialize Photoshop because the file is locked
I am suddenly unable to open my pictures in Adobe Photoshop. It gives the following message: The document "Tina-19.jpg" could not be opened. Photoshop cannot open files in the  "Adobe Photoshop JPEG file" format. What does this mean? I have opened my phot
I created a file in Photoshop CS5 (a photo) and another in Illustrator CS5 (a graph) to place in my InDesign CS5 brochure. When the Photoshop and Illustrator files are placed in InDesign, they look blurry - whether viewed in InDesign, printed, or saved as
Overwriting the File in File Adapter
File Overwriting in File Receiver Communication Channel
Could not initialize Photoshop because the file is empty.
Adobe Photoshop CS6 won't load on my macbook pro, says "Could not initialize Photoshop because the file was invalid (it has been deleted).
Opening Photoshop CS3 psd files in Photoshop CS2 (Mac Tiger 10.411)
How to open your Photoshop Touch project file in Photoshop
Problem in Overwriting the file in Receiver File adapter
Overwrite existing file not working for FTP
CS2/W8 - Could not initialize photoshop because the file is locked
How come my Nikon D610 can not open photoshop CS6 raw files
I am trying to save a photoshop CS6 psd file to jpg and get an option jpg, jpg2000 or jpg stereo, I choose jpg and then Mac 256 colours, normal or interlaced.  I just want regular jpg with a high resolution.  What am I doing wrong, never had this problem
Not overwriting server files still unresolved
Some files need to be updated first .Specify --force to overwrite remote files. while vlt command co
I cannot open photoshop due to file damaged by disc error

Overwrite Exisiting Files - error

-0001-11-30

I see this questions has come up a few times, but having read the answers it seems i still have a problem.  can someone clarify if i am making an error my workflow please? Take images in Folder XXX and develop them Export these images to a new folder

How to save for web AND overwrite original files with Action?

2015-10-11

Hello, I want to compress a batch of images with "save for web" using a Photoshop Action, and I also want to preserve my folder structure and overwrite source files. The structure is important because it's complex and needs to be structured this

Could not initialize Photoshop because the file is locked

2015-10-11

I have the problem where you get the Could not initialize Photoshop because the file is locked, where the solution was to fix the properties in the jpg. I did that and tried the Ctrl-Alt-Shft thing too. I pressed them in time and got the message to d

I am suddenly unable to open my pictures in Adobe Photoshop. It gives the following message: The document "Tina-19.jpg" could not be opened. Photoshop cannot open files in the  "Adobe Photoshop JPEG file" format. What does this mean? I have opened my phot

2015-10-11

I am suddenly unable to open my pictures in Adobe Photoshop. It gives the following message: The document "Tina-19.jpg" could not be opened. Photoshop cannot open files in the  "Adobe Photoshop JPEG file" format.   What does this mean?

I created a file in Photoshop CS5 (a photo) and another in Illustrator CS5 (a graph) to place in my InDesign CS5 brochure. When the Photoshop and Illustrator files are placed in InDesign, they look blurry - whether viewed in InDesign, printed, or saved as

2015-10-11

I created a file in Photoshop CS5 (a photo) and another in Illustrator CS5 (a graph) to place in my InDesign CS5 brochure. When the Photoshop and Illustrator files are placed in InDesign, they look blurry - whether viewed in InDesign, printed, or sav

Overwriting the File in File Adapter

2015-10-11

Hi All, I hav a module processor (in Receiver file Adapter)which checks the existence of the file by name DOWN.flg befor writing the file by the same name at the same location. if the file already exists, then it has to wait until another system dele

File Overwriting in File Receiver Communication Channel

2015-10-11

Hi, I have an IDoc to File scenario. My file receiver communication channel has the following parameters : - File name scheme = %timestamp%_AOBSD4RL.MES   (I'm using variable substition and the variable "timestamp" is initialized at mapping time

Could not initialize Photoshop because the file is empty.

2015-10-11

I tried to start Photoshop 5.1 64bit today, and it shows the blue intro screen with the reading and loading, and then it goes to a popup error message that reads, "Could not initialize Photoshop because the file is empty." I can run the 32bit ve

Adobe Photoshop CS6 won't load on my macbook pro, says "Could not initialize Photoshop because the file was invalid (it has been deleted).

2015-10-11

Adobe Photoshop CS6 won't load on my macbook pro, says "Could not initialize Photoshop because the file was invalid (it has been deleted).Tried the preferences, they are not there, tried uninstalling and reinstalling, no love! Any help?Read other 3 a

Opening Photoshop CS3 psd files in Photoshop CS2 (Mac Tiger 10.411)

2015-10-11

Is it possible to open Photoshop CS3 psd files in Photoshop CS2? After I created them in Photoshop CS3 I reset the preferences to maximize compatibility "always", then I resaved all the psd files. Do you think this will work? I have to open them

How to open your Photoshop Touch project file in Photoshop

2015-10-11

How to open your Photoshop Touch project file in Photoshop When your files are stored in the Creative Cloud, you can access them on your mobile device using Adobe Photoshop Touch, or on your desktop computer using Adobe Photoshop. Photoshop Touch can

Problem in Overwriting the file in Receiver File adapter

2015-10-11

Hi  all, I configured my scenario Proxy to File. Every day the back ground job runs in SAP and send all Employee Details to XI, XI then write it into File in XI server, in Receiver File adapter i enable overwrite existing file. But some times its ove

Overwrite existing file not working for FTP

2015-10-11

Hi XI Folks, I am trying not to overwrite the file at receiver - FTP server. It is getting overwritten though I uncheck 'Overwrite existing file' checkbox in FTP. But the same is working fine for NFS. Please find the config details below. Receiver co

CS2/W8 - Could not initialize photoshop because the file is locked

2015-10-11

I just upgraded to Windows 8 64 bit last night.  I had been running Cs2 just fine on Windows 7 64 bit for a few years now.   In fact I used it last week.  Now after the upgrade is complete, I get this error message when I try to launch CS2:  Could no

How come my Nikon D610 can not open photoshop CS6 raw files

2015-10-11

any one know,i just bough a New Nikon D610 digitalcamera, i am upload in to Photoshop CS6 raw file, but can not open,why?Nikon D610 support is coming in the next version of Adobe Camera Raw 8.3 http://labs.adobe.com/technologies/cameraraw8-3/?tabID=d

I am trying to save a photoshop CS6 psd file to jpg and get an option jpg, jpg2000 or jpg stereo, I choose jpg and then Mac 256 colours, normal or interlaced.  I just want regular jpg with a high resolution.  What am I doing wrong, never had this problem

2015-10-11

I am trying to save a photoshop CS6 psd file to jpg and get an option jpg, jpg2000 or jpg stereo, I choose jpg and then Mac 256 colours, normal or interlaced.  I just want regular jpg with a high resolution.  What am I doing wrong?  , never had this

Not overwriting server files still unresolved

2015-10-11

Reposted from a 2009 post in a 2007 thread: DW CS2 was overwriting server files on PUT all the time, and now sometimes doesn't. GoDaddy.COM tech support suggests it is likely a DW issue. I agree. I upload an update to a file already existing on the s

Some files need to be updated first .Specify --force to overwrite remote files. while vlt command co

-0001-11-30

Hi apps\collab\commons\components\components\.content.xml: Some files need to be updated first .Specify --force to overwrite remote files. while vlt command co What has to be done?have you tried vlt up --force ? Make sure that you are using latest ve

I cannot open photoshop due to file damaged by disc error

-0001-11-30

I cannot open CS5 due to this message "could not initialize photoshop because the file has been damaged due to disc errorJJ,     I tried everything you mentioned but to no avail, still getting the same response "could not initialize photoshop be