• 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
Re: How can I pass a counter result out of a script object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: How can I pass a counter result out of a script object
  • Next by Date: Re: Convert MS Word to HTML
  • Previous by thread: Re: How can I pass a counter result out of a script object
  • Next by thread: Re: How can I pass a counter result out of a script object
  • Index(es):
    • Date
    • Thread