• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Broken script in 9.2.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Broken script in 9.2.2


  • Subject: Broken script in 9.2.2
  • From: Hellum Timothy <email@hidden>
  • Date: Tue, 18 Dec 2001 14:51:22 -0500

Hello List,

I had a helpful associate adapt a script offered by Sal Saghoian to read
EPS files dropped on it for colourspace. We recently upgraded our machines
here in the office to 867s/9.2.2. That wonderful script is now broken and I
wonder if someone might point out the dropped/added features that this
script does/does not address. Unfortunately I am no longer able to contact
my associate or I would most certainly have asked him first.

Ask for as I know, this script requires only Jon's Commands. But perhaps
someone recognizes something that points at another OSAX as well?

Many thanks indeed for any help.

Script as follows:

(*
This Folder Action handler is triggered when items are added to the attached
folder.
Portions ) Sal Soghoian )1998 Apple Computer
*)

-- THIS PROPERTY IS FOR THE NOTIFICATION ROUTINE
property dialog_timeout : 1 -- set the amount of time before dialogs
auto-answer.

-- THESE PROPERTIES ARE FOR THE STATUS CHECKING ROUTINES
property item_check_delay_time : 1
property folder_check_delay_time : 1

--THIS PROPERTY SETS THE SECOND ("MOVED_TO") FOLDERS NAME
property mirrorFolder : "Photo 4:Error Files"

on adding folder items to this_folder after receiving added_items

set theFile to added_items

set fileref to (open for access file ((theFile) as string)) -- open the file
you want to read

try
if copy_checks_indicator is true then
-- CHECK THE FILES TO MAKE SURE THEY"RE COMPLETELY AVAILABLE
set the added_items to my check_added_items(the added_items)
if the added_items is {} then return "no valid items"
end if

tell application "Finder"
--get the name of the folder
set this_folder_name to the name of this_folder
end tell

-- find out how many new items have been placed in the folder
set new_item_count to the number of items in the added_item

end try

try
set theRead to (read fileref from 1 to 1000) -- how many characters
you want to read in the text file
--set AppleScript's text item delimiters to return
close access fileref - (close the file)
on error errMsg number errNum -- if there is an error
close access fileref -- make sure the file is closed
end try

set theheaderlist to +event DTtlAlTi; theRead given +class UsDl;:return
set line8 to item 8 of theheaderlist
if line8 contains "Cyan Magenta Yellow Black" or line8 contains "Black" then

else
play sound "Red Alert"
display dialog "This file failed the filter- sent to Error Files
folder"

try
repeat with anItem in added_items
tell application "Finder"
move anItem to folder mirrorFolder
end tell
end repeat
end try

end if

end adding folder items to


  • Prev by Date: Re: Tex-edit problem !
  • Next by Date: Scripting OSX Directory Services (LDAP)
  • Previous by thread: Re: stripping an extra character from a text item
  • Next by thread: Re: Broken script in 9.2.2
  • Index(es):
    • Date
    • Thread