Re: How can I pass a counter result out of a script object
Re: How can I pass a counter result out of a script object
- Subject: Re: How can I pass a counter result out of a script object
- From: kai <email@hidden>
- Date: Sat, 15 Nov 2003 05:30:10 +0000
on Sat, 15 Nov 2003 05:01:11 +0000 (while scripting a little too late than
is good for me), I wrote:
>
...avoid using BBEdit for the purpose altogether - something like this:
Better still :
-------------------
property e : ".php"
property x : "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
on open (f)
script s
property l : {}
property c : 0
on open f
set n to f as string
if n ends with e then
set l's end to n
set t to read f
set text item delimiters to x
set t to t's text items
set text item delimiters to ""
if (count t) > 1 then
set c to c + 1
set eof f to 0
write (t as string) to f
end if
end if
{l, c}
end open
end script
set {l, c} to walk folders f with script s without invisibles
display dialog "Files ending in \".php\": " & (count l) & "
Files with tags stripped: " & c
end open
-------------------
(I'll get the hang of this game one of these days...)
---
kai
_______________________________________________
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.