Re: preflighting a file
Re: preflighting a file
- Subject: Re: preflighting a file
- From: Emmanuel <email@hidden>
- Date: Tue, 19 Feb 2002 08:34:46 +0100
At 4:45 AM +0100 19/2/02, Shane Stanley wrote:
>
> 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.)
>
>
As long as theData is never more than 32K, that should work.
Sorry for probably asking the obvious, but I do not understand what it is
that will not work beyond 32K.
Only the method with the AppleScript's text item delimiters may break for
long strings (specially if they are full of "Calgray"'s!).
Emmanuel
_______________________________________________
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.