Re: Using variables to target my own newly scriptable app
Re: Using variables to target my own newly scriptable app
- Subject: Re: Using variables to target my own newly scriptable app
- From: Christopher Nebel <email@hidden>
- Date: Thu, 2 Feb 2006 11:56:00 -0800
On Feb 2, 2006, at 3:36 AM, Philip Dow wrote:
I am trying to undertand why one bit of applescript code works but
another does not. The script targets my own cocoa application,
which I am in the process of making scriptable. Because I am new to
both scripting and script-enabled cocoa apps, I am not sure where
the problem is. My script? My code? Any suggestions would be
appreciated.
Here is the problem. The following code works just fine:
tell application "Journler"
set the displayed entry of the last tab to (the second entry of
the active journal)
end tell
whereas this code does not:
tell application "Journler"
tell active journal
set anEntry to (the second entry)
end tell
set the displayed entry of the last tab to anEntry
end tell
This sort of thing is usually caused by not having a correct -
objectSpecifier method on an object, in your case, probably the
"entry" class. When you do it all in one line, Cocoa handles the
object resolution internally, but in the second example, it needs to
generate an object specifier to return to the script.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden