Re: [NTLK] Basilisk/File Types

From: Robert Benschop (rbenschop_at_mac.com)
Date: Mon Mar 04 2002 - 09:11:44 EST


on 04-03-2002 2:47, Marco Mailand at Newton2k1_at_mac.com wrote:

> Sorry that I can not yet provide the AppleScript code, it is at home.

Here you go:

on open (flist)
    tell application "Finder"
        repeat with theFile in flist
            if kind of theFile is not "folder" then
                try
                    set oldDelims to AppleScript's text item delimiters
                    set AppleScript's text item delimiters to "."
                   
                    set theType to last text item of ((file theFile) as
string)
                   
                    if (theType = "pkg") then
                        set file type of file theFile to "pkg "
                        set creator type of file theFile to "1NCU"
                    end if
                    set AppleScript's text item delimiters to oldDelims
                on error
                    set AppleScript's text item delimiters to oldDelims
                end try
            end if
        end repeat
    end tell
end open

Robert Benschop

-- 
Have you checked the FAQ lately? http://www.guns-media.com/mirrors/newton/faq/
This is the NewtonTalk mailing list - http://www.newtontalk.net
To unsubscribe/manage: visit the above link. Questions: victor_at_newtontalk.net



This archive was generated by hypermail 2.1.2 : Tue Apr 02 2002 - 14:02:02 EST