Re: find a string in a file
Re: find a string in a file
- Subject: Re: find a string in a file
- From: Emmanuel <email@hidden>
- Date: Sat, 24 May 2003 14:14:33 +0200
At 9:57 PM -0400 23/05/03, Gary Lists wrote:
>
On or about 5/23/03 8:10 PM, Emmanuel wrote:
>
>
> or:
>
>
>
> -------------------------- untested
>
> set eFile to alias "EEHD:efile9.txt"
>
> set fileText to read eFile
>
>
>
> if offset of "%%" in fileText is 0 then
>
> display dialog "Not there."
>
> else
>
> display dialog "Found"
>
> end if
>
> ---------------------------------
>
>
>
> Emmanuel
>
>
>
As written, this produced the error:
>
>
Can't make 0 into a boolean.
>
>
Parentheses did the trick (oddly?)
>
>
Changing the if... to
>
>
(offset of "%%" in fileText)
>
>
worked for me. OS9.1.2, AS 1.8.3
Thanks for telling us.
Still not testing nor RTFM I understand that "is" has higher precedence than "in".
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.