Re: preflighting a file
Re: preflighting a file
- Subject: Re: preflighting a file
- From: Kai Edwards <email@hidden>
- Date: Tue, 19 Feb 2002 03:24:41 +0000
on Tue, 19 Feb 2002 08:28:12 +1100, Shane Stanley
<email@hidden> wrote:
>
> At 5:16 PM +0100 18/2/02, Debbie McNerney wrote:
>
>
>
>> I am desperately trying to find/modify an applescript (drag and drop) that
>
>> will search for and alert a user for this CalGray type. Can someone point me
>
>> to the right direction. I am willing to put in some work to do this for our
>
>> people here. Just need a little direction.
>
You will probably have to read in enough text to contain the relevant part,
>
and use text item delimiters:
>
>
set theFile to choose file
>
set fileref to open for access theFile
>
set someData to read fileref for 4024 -- however much you need
>
close access fileref
>
set oldDelims to AppleScript's text item delimiters
>
set AppleScript's text item delimiters to {"CalGray"}
>
set x to count of text items of someData
>
set AppleScript's text item delimiters to oldDelims
>
if x > 1 then
>
beep
>
display dialog "We have a right one here, Johnny..."
>
end if
Wouldn't this work?...
set theFile to open for access (choose file)
set theData to read theFile
close access theFile
if "CalGray" is in theData then display dialog "I wouldn't if I were you..."
(Accepting of course that limiting the read command - with something like
'for 4024' - might still be required where large files may be involved.)
Kai
--
**********************************
Kai Edwards Creative Resources
1 Compton Avenue Brighton UK
Telephone +44 (0)1273 326810
**********************************
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.