Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script to read resource forks and add extension to file?




On Oct 15, 2004, at 2:39 PM, ScienceQuest wrote:

On 04/10/15 11:38 AM, "Josh Wisenbaker" <email@hidden> wrote:

Plus it didn't check to see if it had an extension already... This one
does

"on open (theList)
set itemCount to number of items in theList
tell application "Finder"
repeat with theItem in theList
set currentName to the name of theItem
set hasExtension to (character -4 of currentName as text)
if hasExtension is "." then

Wouldn't it be better (in case the file has .s in the name or has a short
name to use the name extension property of the item?


    on open (theList)
    set itemCount to number of items in theList
    tell application "Finder"
        repeat with theItem in theList
            set {fType, fExt} to {type, name extension} of theItem
            if fExt is not "" then -- etc.

Anything is probably better than that 1 minute hack job I did. :)

I was just trying to give direction, not a full blow solution on a break at work.

Josh
-
Josh Wisenbaker, ACSA
Sr. Systems Engineer
ComputerTree Technologies
1-800-467-9820


_______________________________________________ Do not post admin requests to the list. They will be ignored. Macos-x-server mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/macos-x-server/email@hidden

This email sent to email@hidden
References: 
 >Re: Script to read resource forks and add extension to file? (From: ScienceQuest <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.