Using variables to target my own newly scriptable app
Using variables to target my own newly scriptable app
- Subject: Using variables to target my own newly scriptable app
- From: Philip Dow <email@hidden>
- Date: Thu, 2 Feb 2006 12:36:11 +0100
Hiya all,
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
The anEntry variable should in fact be the second entry of the active
journal, as far as I can tell, but when I run the code, I get an
NSReceiverEvaluationScriptError: 4 with "set the displayed entry of
the last tab to anEntry" highlighted. It does not matter if I declare
the anEntry variable a global outside of the tell application block.
Is this a scripting error? Do I need to do something in my treatment
of anEntry to get this working. Or should I take a closer look at my
application's code and its scripting definitions?
-Phil
_______________________________________________
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