Re: More 9.1 Problems

From: Paul Berkowitz (berkowit@SILCOM.COM)
Date: Tue May 22 2001 - 00:39:32 AEST


On 5/21/01 2:39 AM, "Roy McCoy" <roy@LUNA.NL> wrote:

>> I prefer Akua Sweets 'the entries in selectedFolder as alias'.
>
> I'll try that, since I have Akua Sweets... Durn, I haven't been scripting
> so long that I'd forgotten what the frustrating midnight anxiety was like.
> I could get {alias " Great Royzito:Test Folder:Test File 1.htm", alias
> " Great Royzito:Test Folder:Test File 2.htm", alias " Great Royzito:Test
> Folder:Test File 3.html", alias " Great Royzito:Test Folder:Test File
> 4.html"}, but I couldn't do anything practical with the list items.
> Specifically, I couldn't change the creator type of the files with names
> ending in "htm" or "html" to "R*ch". I've missed, forgotten, or never
> learned something, but I don't know what it is. Starting from such a
> returned list, how do I (1) test for "htm" or "html" in the file name,
> and (2) get "set creator type of [???] to "R*ch"" to work?

Since you're using Akua Sweets, the quickest way would be to use its 'the
entries in' with a parameter to get just the files you want, saving all the
testing, then use Akua's 'basic info for' which is faster than the Standard
'info for' since it doesn't check file size, and 'apply catalog info' to do
the changing, which is much faster than the Finder:

-------------
set htmFiles to the entries in someFolder whose names match "*.htm*" as
alias

repeat with i from 1 to (count htmFiles)
    set htmFile to item i of htmFiles
    set fileInfo to basic info for htmFile
    set file creator of fileInfo to "R*ch"
    apply catalog info fileInfo to htmFile
end repeat
----------------

This won't take more than a second or two either, since it doesn't need the
Finder as does Joe's version with Tanaka's. (The asterisks are "wild cards".
I can't imagine that there's any file name containing ".htm" plus any
character other than an "l"  at the end, but if you wanted to be really
precise you could change the first line to:

set htmFiles to the entries in someFolder whose names match "*.htm" as alias
set htmlFiles to the entries in someFolder whose names match "*.html" as
alias
set htmFiles to htmFiles  & htmlFiles

I don't think it's necessary: the version "*.htm*" should work fine. To get
".shtml" files omit the period or add an extra line.


--
Paul Berkowitz

------------------------------



This archive was generated by hypermail 2b29 : Sun May 27 2001 - 12:00:29 AEST