Re: [NTLK] Re - PackType

From: Robert Benschop (rbenschop_at_mac.com)
Date: Thu Oct 11 2001 - 10:35:47 EDT


on 11-10-2001 11:51, Steve Weyer at weyer_at_kagi.com wrote:

> no particular prowess or even programming with PackType -- it's just a
> trivial little droplet created with FileTyper.

Packtype did the job for me for years, without a problem but I guess
something in my system changed (and I tried to correct all of the settings
in both the File Exchange and the Internet control panels, to no avail) and
it doesn't do the job for me anymore.
Instead I now use a little Applescript, thanks to Bill Davis that does it
just as elegantly, for whoever needs it:

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

Paste this in the script editor and save it as a Classic Applet and it does
the job just as wonderful as PackType.

Robert Benschop

--
This is the Newtontalk mailinglist - http://www.newtontalk.net
To unsubscribe or manage: visit the above link or
	mailto:newtontalk-request_at_newtontalk.net?Subject=unsubscribe



This archive was generated by hypermail 2.1.2 : Thu Nov 01 2001 - 10:01:55 EST