This is the current code. It’s still popping up the -4960 error. Interestingly enough, after I get the error, if I try to drop the renamed file on the droplet a second time, it will process successfully.
on open droppedfiles
repeat with afile in droppedfiles
--MAKING A BACKUP COPY OF THE IMAGE TO A FOLDER BEFORE PROCESSING
tell application "Finder"
activate
try
set backupFolder to alias "Users:mbornbach:Desktop:Pre-Silo Backups:"
--"Volumes:nas:Advertising Department:5_ADVERTISING DEPT - PREPRESS:1_ADV IMAGE PROCESSING:2_PROCESSING:Melissa Processing:Scripts:Pre-Silo Backups:"
set fileToMove to afile
duplicate fileToMove to backupFolder with replacing
end try
end tell
--ON TO THE PHOTOSHOP PROCESSING
tell application "Adobe Photoshop CC 2014"
activate
set display dialogs to never
open afile showing dialogs never
--TELLING PHOTOSHOP TO USE PIXEL MEASUREMENTS AND SETTING THE TARGET IMAGE SIZE SO IT CAN RESIZE THE IMAGE LATER ON
set ruler units of settings to pixel units
set target_size to 1550
--DOING ALL THE PHOTOSHOP WORK
tell current document
try
--CHANGING TO CMYK
change mode to CMYK
--FLATTENING IMAGE
flatten
--SETTING NAME OF PATH AND TURNING IT INTO A CLIPPING PATH
select first path item
if name of first path item is not "Path 1" then set name of first path item to "Path 1"
make clipping path of first path item flatness 2
--CROPPING THE IMAGE
create selection first path item feather amount 0 with antialiasing
expand selection by 25
set theCropBounds to bounds of selection
crop bounds theCropBounds
--RESIZING THE IMAGE IF IT IS TOO BIG
set long_side to height
set long_side_identity to 1
if width > long_side then set long_side_identity to 2
if width > long_side then set long_side to width
if long_side > target_size as integer and long_side_identity = 1 then
resize image height target_size resolution 300 resample method bicubic
end if
if long_side > target_size as integer and long_side_identity = 2 then
resize image width target_size resolution 300 resample method bicubic
end if
close saving yes
--TELLING PHOTOSHOP WHAT TO DO IF THERE'S AN ERROR
on error
close afile
tell application "Finder"
activate
set fileToMove to afile
set oldDelims to AppleScript's text item delimiters
set fileExt to name extension of fileToMove
--ADDING _ERROR TO FILENAME FOR PROBLEM FILES
set AppleScript's text item delimiters to {"."}
set fileName to name of fileToMove --> ex. Disneyland.tif
set nameWithoutExtension to first text item of fileName --> Disneyland
set newName to nameWithoutExtension & "_ERROR" & "." & fileExt --> Disneyland_s_4c.tif
set name of fileToMove to newName
--RESETTING APPLESCRIPT'S TEXT ITEM DELIMITERS
set AppleScript's text item delimiters to oldDelims
set name of fileToMove to fileToMove_Name
end tell
end try
end tell
--DONE WITH PHOTOSHOP, NOW USING THE FINDER TO RENAME THE FILE, ADDING _s_4c to THE IMAGE NAME
tell application "Finder"
activate
set fileToMove to afile
set fileToMove_Name to name of fileToMove
set fileExt to name extension of fileToMove
set oldDelims to AppleScript's text item delimiters
try
--ELIMINATING _4c on IMAGES THAT ALREADY HAD _4c IN FILE NAME BEFORE PROCESSING
if name of fileToMove contains "_4c" and name of fileToMove does not contain "_s_4c" then
set AppleScript's text item delimiters to {"_4c"}
--ELIMINATING DOUBLE _s_4c on IMAGES THAT ALREADY HAD _s_4c IN FILE NAME BEFORE PROCESSING
else if name of fileToMove contains "_s_4c" then
set AppleScript's text item delimiters to {"_s_4c"}
--FOR IMAGES THAT DIDN'T HAVE _s_4c IN FILE NAME BEFORE PROCESSING
else if name of fileToMove does not contain "_s_4c" or "_4c" then
set AppleScript's text item delimiters to {"."}
end if
set fileName to name of fileToMove --> ex. Disneyland.tif
set nameWithoutExtension to first text item of fileName --> Disneyland
set newName to nameWithoutExtension & "_s_4c" & "." & fileExt --> Disneyland_s_4c.tif
set name of fileToMove to newName
--RESETTING APPLESCRIPT'S TEXT ITEM DELIMITERS AND NAME
set AppleScript's text item delimiters to oldDelims
set name of fileToMove to fileToMove_Name
set afile to fileToMove # ADDED
--TELLING FINDER TO RESET APPLESCRIPT'S TEXT ITEM DELIMITERS IF THERE'S AN ERROR
on error
set AppleScript's text item delimiters to oldDelims
end try
end tell
--FILING THE IMAGES
tell application "Finder"
activate
set fileToMove to afile
set fileToMove_Name to name of fileToMove as string
set fileExt to name extension of fileToMove as string
--DUPLICATE FILE TO DEB'S CONVERT FOLDER ON R DRIVE
try
if fileExt is "tif" then
duplicate fileToMove to alias "Volumes:sdrive:IMAGES_FROM PREPRESS:z_DEBORAH_CONVERT and FILE:"
else
move fileToMove to alias "Volumes:server1:Advertising Department:5_ADVERTISING DEPT - PREPRESS:1_ADV IMAGE PROCESSING:2_PROCESSING:Processing:Scripts:Convert:"
end if
--Moving file to the "File Manually in RDRIVE & 1_4c IMAGES folder" inside the Processing Folder if there is an error
on error
move fileToMove to alias "Volumes:server1:Advertising Department:5_ADVERTISING DEPT - PREPRESS:1_ADV IMAGE PROCESSING:2_PROCESSING:Processing:Scripts:File Manually in RDRIVE & 1_4c IMAGES:" with replacing
end try
--ONTO FILING INTO THE 1_4C IMAGES FOLDERS
try
--DECLARING LISTS OF STRINGS OF CHARACTERS FOR THE COMPUTER TO LOOK FOR
--AG Files
set AG00string to {"AG00", "AG01", "AG02", "AG03"}
set AG04string to {"AG04", "AG05", "AG06", "AG07", "AG08", "AG09"}
set AGAstring to {"AGA", "AGB", "AGC", "AGD", "AGE", "AGF", "AGG", "AGH", "AGI", "AGJ", "AGK", "AGL", "AGM", "AGN", "AGO", "AGP", "AGQ", "AGR", "AGS", "AGT", "AGU", "AGV", "AGW", "AGX", "AGY", "AGZ"}
set AG_Astring to {"AG_A", "AG_B", "AG_C", "AG_D", "AG_E", "AG_F", "AG_G", "AG_H", "AG_I", "AG_J", "AG_K", "AG_L", "AG_M", "AG_N", "AG_O", "AG_P", "AG_Q", "AG_R", "AG_S", "AG_T", "AG_U", "AG_V", "AG_W", "AG_X", "AG_Y", "AG_Z"}
--BI Files
set BI0string to {"BI0", "BI1", "BI2", "BI3", "BI4", "BI5"}
set BI6string to {"BI6"}
set BI7string to {"BI7"}
set BI8string to {"BI8"}
set BI9string to {"BI9"}
set BIAstring to {"BIA", "BIB", "BIC", "BID", "BIE", "BIF", "BIG", "BIH", "BII", "BIJ", "BIK", "BIL", "BIM", "BIN", "BIO", "BIP", "BIQ", "BIR", "BIS", "BIT", "BIU", "BIV", "BIW", "BIX", "BIY", "BIZ"}
set BI_Astring to {"BI_A", "BI_B", "BI_C", "BI_D", "BI_E", "BI_F", "BI_G", "BI_H", "BI_I", "BI_J", "BI_K", "BI_L", "BI_M", "BI_N", "BI_O", "BI_P", "BI_Q", "BI_R", "BI_S", "BI_T", "BI_U", "BI_V", "BI_W", "BI_X", "BI_Y", "BI_Z"}
--MOVING THE ACTUAL FILES TO THE 1_4C IMAGES FOLDERS
--Moving AG files to 1_4c IMAGES Folders
if AG00string contains (text 1 thru 4 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:AG-high res images:AG00 - AG03 - HI RES:"
else if AG04string contains (text 1 thru 4 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:AG-high res images:AG04 - AG09 - HI RES:"
else if AGAstring contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:AG-high res images:AGA - AGZ - HI RES:"
else if AG_Astring contains (text 1 thru 4 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:AG-high res images:AGA - AGZ - HI RES:"
--Moving BI files to 1_4c IMAGES Folders
else if BI0string contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BI0 - BI5 - HI RES:"
else if BI6string contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BI6 - HI RES:"
else if BI7string contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BI7 - HI RES:"
else if BI8string contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BI8 - HI RES:"
else if BI9string contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BI9 - HI RES:"
else if BIAstring contains (text 1 thru 3 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BIA - BIZ - HI RES:"
else if BI_Astring contains (text 1 thru 4 of fileToMove_Name) then
move fileToMove to alias "Volumes:server1:Advertising Department:2_IMAGES - HIGH RES FOR PRINT:1_4c IMAGES:BI-high res images:BIA - BIZ - HI RES:"
--Moving All Other Files to the "File Manually in 1_4c IMAGES" Folder inside the Processing Folder
else
move fileToMove to alias "Volumes:server1:Advertising Department:5_ADVERTISING DEPT - PREPRESS:1_ADV IMAGE PROCESSING:2_PROCESSING:Processing:Scripts:File Manually in 1_4c IMAGES:"
end if
--Moving Files to the "File Manually in 1_4c IMAGES" Folder inside the Processing Folder if there is an error
on error
move fileToMove to alias "Volumes:server1:Advertising Department:5_ADVERTISING DEPT - PREPRESS:1_ADV IMAGE PROCESSING:2_PROCESSING:Processing:Scripts:File Manually in 1_4c IMAGES:"
end try
end tell
end tell
end repeat
end open