RE: Moving large PDF files with Applescript
RE: Moving large PDF files with Applescript
- Subject: RE: Moving large PDF files with Applescript
- From: "Pascal van den Bulck" <email@hidden>
- Date: Tue, 31 Mar 2009 22:12:23 +0200
- Importance: normal
- Priority: normal
Title: RE: Moving large PDF files with Applescript
I remember a script ADD - DUPLICATE TO FOLDERS from Sal Soghoian ©1998 Apple Computer that was about checking if new items were added to a folder.
There was a routine used that would check the file type of the added item. If it did not start with "bzy", than the item was completed/fully added to the folder.
Your problem that when the files are being copied into the source folder, the script will try and grab the file before it is completely copied can be solved by adjusting this routine to your needs:
on check_busy_status(this_item)
-- a folder can contain items partially transfered
-- this routine will wait for all the folder contents to transfer
if the last character of (this_item as text) is ":" then
set the check_flag to false
repeat
-- look for any files within the folder that are still transferring
tell application "Finder"
try
set the busy_items to the name of every file of the entire contents of this_item ¬
whose file type begins with "bzy"
on error
set the busy_items to {}
end try
end tell
if the check_flag is true and the busy_items is {} then return false
-- pause for the indicated time
delay the folder_check_delay_time
-- set the flag and check again
set the check_flag to true
end repeat
else -- the passed item is a single file, suitcase, clipping, etc.
-- check the label of the item. If it is the marked label, then it's already been processed so ignore.
tell application "Finder"
if (the label index of this_item) as integer is the special_label_index then
return "ignore"
end if
end tell
set the check_flag to false
repeat
tell application "Finder"
set the item_file_type to the file type of this_item
end tell
if the check_flag is true and ¬
the item_file_type does not start with "bzy" then
tell application "Finder"
set the label index of this_item to the special_label_index
end tell
-- allow the Finder time to change the label
delay the item_check_delay_time
return false
else if the item_file_type does not start with "bzy" then
-- set the flag and check again
set the check_flag to true
end if
-- pause for the indicated time
delay the item_check_delay_time
end repeat
end if
end check_busy_status
Pascal van den Bulck
--
Morres Wonen BV
Marketing/Grafic Design
---------------------------- DISCLAIMER -----------------------------
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorised use
or dissemination of this message in whole or in part is strictly prohibited.
Please note that e-mails are susceptible to change. Morres Wonen B.V.
(including its group companies) shall not be liable for the improper or
incomplete transmission of the information contained in this communication
nor for any delay in its receipt or damage to your system. Morres Wonen B.V.
(or its group companies) does not guarantee that the integrity of this
communication has been maintained nor that this communication is free of
viruses, interceptions or interference.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden