I have a folder action running on OS X 10.3.9 server. This script changes pdf’s that are placed into this folder into JPG’s. or more exactly, makes a copy of them as JPG’s.
This works fine, and as PDF’s are added they are copied into JPG’s. However I have discovered that when someone manually adds or removes one of the PDF’s, Folder Actions become disabled on that folder.
I’ll add a copy of the script. If it looks messy, be gentle as I’mvery new to this.
Cheers Dave.
property done_foldername : “JPGs”
property newimage_extension : “jpg”
property type_list : {“PDF”}
property extension_list : {“tif”, “pdf”, “tiff”, “gif”, “png”, “pict”, “pct”}
on adding folder items to this_folder after receiving these_items
tell application “Finder”
set the results_folder to (folder “JPGs” of folder “ad pdfs” of disk “production x”) as alias
end tell
try
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
set the item_info to the info for this_item
if (alias of the item_info is false and the file type of the item_info is in the type_list) or (the name extension of the item_info is in the extension_list) then
tell application “Finder”
set the source_file to this_item
end tell
process_item(source_file, results_folder)
end if
end repeat
end try
end adding folder items to
– this sub-routine processes files
on process_item(source_file, results_folder)
try
– the target path is the destination folder and the new file name
set the target_path to ((results_folder as string)) as string
with timeout of 900 seconds
tell application “Image Events”
launch – always use with Folder Actions
set this_image to open file (source_file as string)
save this_image as JPEG in file target_path with icon
close this_image
end tell
end timeout
end try
end process_item
Model: Xserver
Browser: Internet Explorer 7.0
Operating System: Mac OS X (10.3.9)