MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Rob Jorgensen <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 26 May 2003 20:57:59 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (38 lines)
At 8:35 PM -0400 5/26/03, Chip Griffin 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".

Because theItem is a list that can contain more than one item. One of
these should work:

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

--
set theItem to {alias "Macintosh HD:Users:chip:Pictures:dog_cats.jpg"}
tell application "Finder"
        set comment of item 1 of theItem to "Test Test"
end tell
--

--

Rob Jorgensen
Ohio, USA

ATOM RSS1 RSS2