realbasic-nug
[Top] [All Lists]

Re: Trouble with AppleScript and RB

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Trouble with AppleScript and RB
From: Peter Truskier <peter at premediasystems dot com>
Date: Mon, 31 May 2004 08:34:43 -0700
Delivered-to: realbasic-nug at lists dot realsoftware dot com
List-help: <mailto:realbasic-nug-request@lists.realsoftware.com?subject=help>
List-id: REALbasic NUG <realbasic-nug.lists.realsoftware.com>
List-post: <mailto:realbasic-nug@lists.realsoftware.com>
References: <BAY16-F84cI5jabgAEf00055b3b at hotmail dot com>
The return value is not a string, but a constant with a name that look slike the string your hoping for. You can coerce this to a string by adding "as string" to your main line of code:

        Set s to the player state as string

-- Peter


On May 31, 2004, at 6:28 AM, Dave DeLong wrote:

Hi List,

I have this applescript:

On Run
 Tell Application "iTunes"
   Set s to the player state
 end tell
 return s
end run

When I import it into RB and call the script, i'm supposed to get "playing", "paused", "stopped", "fast forwarding", or "rewinding". But what I get instead is some gibberish about "<<Constant***...."

Any ideas? (And I don't think it's an encoding issue because I have other applescripts in the same program that all run correctly)

Thanks,

Dave

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>