Dateien ausdrucken mit OrdnerAktion

moosbach

Granny Smith
Registriert
21.07.08
Beiträge
15
Hallo,
ich möchte gerne PDF Dateien, die mit einem bestimmten Namen anfangen, automatisch ausdrucken lassen. Dabei sollen nur die neusten Pdf Dateien gedruckt werden. Dafür habe ich dieses AppleScript als Ordneraktion ausgewählt. Bei diesem Script werden jetzt schon die neusten Dateien gedruckt. Aber wie kann ich das auf die Dateien mit einem bestimmten Namen herausfiltern?

property dialog_timeout : 30 -- set the amount of time before dialogs auto-answer.

on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell

-- find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
--create the alert string
set alert_message to ("Folder Actions Alert:" & return & return) as Unicode text
if the item_count is greater than 1 then
if the item_name contain Rechnung-3 then
set alert_message to alert_message & (the item_count as text) & " new items have "
else
set alert_message to alert_message & "One new item has "
end if
set alert_message to alert_message & "been placed in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
set the alert_message to (the alert_message & return & return & "Would you like to view the added items?")

display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
set the user_choice to the button returned of the result

if user_choice is "Yes" then
tell application "Finder"
--go to the desktop
activate
--open the folder
open this_folder
--select the items
print the added_items
end tell
end if
end try
end adding folder items to