Skip to main content
Mattmcquiff
Inspiring
July 8, 2013
Question

applescript, CS5 to CS6, files won't close

  • July 8, 2013
  • 1 reply
  • 512 views

This is the part of my script, that runs from with photoshop. on CS5 it opened and closed everything without a problem, however in CS6 it processes the images but does not close them.

Can anyone see where it might be going wrong?

Let me know if you need the whole thing and I'll condense it down.

Many Thanks

Matt

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 & origName) as Photoshop format with options myPSDOptions without copying

                                                                                (delete layer "Original Image") flatten

 

  resize image resolution 300 resample method none

 

  --sharpen image

  filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}

 

  save in (ftpBrandFolder_High_Res & name) as JPEG with options myOptions without copying

 

  --Prepare for Low RES by resetting image history

                                                                                set current history state to history state 3

 

                                                                                flatten

 

                                                                                resize image width 1348

  resize image resolution 300 resample method none

  filter current layer using unsharp mask with options {amount:80, radius:3.2, threshold:0}

 

  --add save to lowResFolder with same options

  save in (networkBrandFolder_Low_Res & name) as JPEG with options myOptions without copying

 

                                                                                set newFile to file path

                                                                                set newFile2 to newFile as string -- for testing end of name

                                                                                if newFile2 ends with "_2.jpg" or newFile2 ends with "_3.jpg" or newFile2 ends with "_4.jpg" or newFile2 ends with "_5.jpg" or newFile2 ends with "_6.jpg" or newFile2 ends with "_7.jpg" or newFile2 ends with "_8.jpg" or newFile2 ends with "_9.jpg" or newFile2 ends with "_10.jpg" or newFile2 ends with "11.jpg" then -- exclude website_images

                                                                                          my duplicateFile(newFile, {ftpBrandFolder_Low_Res})

                                                                                else

                                                                                          my duplicateFile(newFile, {ftpBrandFolder_Low_Res, website_images})

                                                                                end if

 

  close saving no

 

  display dialog "A"

                                                                                return

                                                                      end tell

                                                            on error

                                                                      set noError to false

                                                                      my myLogs(thefile) -- write path to log file in Desktop

                                                                      try

  close saving no --if exists, close current document

  display dialog "B"

                                                                                return

                                                                      end try


This topic has been closed for replies.

1 reply

Inspiring
July 8, 2013

I don't have CS6 to test your code… Off the top of my head use with copying… That way the saved files are copies and the current document reference still stands this can get broken along the way when saving to new file… Otherwise try

close the current document saving no

Your code is not complete so its hard to say…