Error during command authentication.

Error - unable to initiate communication with LISTSERV (errno=10061, phase=CONNECT, target=127.0.0.1:2306). The server is probably not started. LISTSERV - MACSCRPT Archives - LISTSERV.DARTMOUTH.EDU

On 5/26/03 5:35 PM, "Chip Griffin" <[log in to unmask]> wrote:

> Why does this script:
>
> -- Begin Script
> set theItem to {alias "Macintosh HD:Users:chip:Pictures:dog_cats.jpg"}
> tell application "Finder"
>         set comment of item theItem to "Test Test"
> end tell
> -- End Script
>
> Yield this error:
>         "Finder got this error: A descriptor type mismatch occurred."
>
> I receive the same error if I tried to set a variable to the "comment
> of item theItem".

You've managed to make the most convoluted expression out of the simplest
things.

For a start. { } braces in AppleScript define a list or a record. they can't
be used like parentheses just to mean "I want to keep the stuff here
together." So:

    {alias "Macintosh HD:Users:chip:Pictures:dog_cats.jpg"}

is a list containing one item, an alias. What do you need a list for?

Naturally the Finder is upset: it can't set comments of AppleScript lists,
only of Finder items (files, folders, disks). But it objects before it even
tries to set a comment: simply the expression

    item {someList}

is all wrong. An AppleScript list can't be a Finder item.

In addition, the Finder will coerce your alias to a file or folder without
the extra 'item' (though that will coerce too). So:

set theItem to alias "Macintosh HD:Users:chip:Pictures:dog_cats.jpg"
tell application "Finder" to set comment of theItem to "Test Test"


(To avoid all coercions, you would do:

set filePath to "Macintosh HD:Users:chip:Pictures:dog_cats.jpg"
tell application "Finder" to set comment of item filePath to "Test Test"

)

--
Paul Berkowitz