I am trying to get my script to open Photoshop and convert pdf’s to jpeg’s with the on adding items to folder event.
The script works well until the line I have in my code "display dialog “Check 4” . I have went through numerous related post in this forum trying to figure out what I have done wrong, and I just can’t seem to get it.
I realize this script is a little choppy. I have went on about 4 hours of sleep for over a week now. I have read through many applescripting guides and forums.
Any help is appreciated.
(*
ADD - NEW ITEM ALERT
�2002 Apple Computer
This Folder Action script is designed for use with Mac OS X version 10.2 and higher.
This Folder Action handler is triggered whenever items are added to the attached folder.
*)
–establish folders to be used
property dialog_timeout : 30 – set the amount of time before dialogs auto-answer.
on adding folder items to this_folder after receiving added_items
set outputFolder to “Macintosh_OS_X:Users:jeffreyd:Desktop:NewJPEGs:”
tell application “Finder”
activate
set filesList to every file in this_folder
end tell
tell application “Adobe Photoshop CS”
set display dialogs to never
close every document saving no
end tell
repeat with aFile in filesList
set fileIndex to 0
tell application “Finder”
set theFile to aFile as alias
set theFileName to name of theFile
end tell
tell application “Adobe Photoshop CS”
activate
open theFile as PDF
set docRef to the current document
– Convert the document to a document mode that supports saving as jpeg
if (mode of docRef is not RGB) then
change mode docRef to RGB
end if
set docName to name of docRef
set fileIndex to fileIndex + 1
set newFileName to (outputFolder as string) & docName
set myOptions to �
{class:JPEG save options, embed color profile:false, quality:3, format options:standard, matte:none}
display dialog "Check 4" My Script stops after this
save docRef in file newFileName as JPEG with options myOptions appending lowercase extension with copying
display dialog "Get some rest"
close current document without saving
end tell
end repeat
end adding folder items to