• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using variables to target my own newly scriptable app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Using variables to target my own newly scriptable app
      • From: Christopher Nebel <email@hidden>
    • Re: Using variables to target my own newly scriptable app
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Q: GraphicsConverter Paste At (format for position?)
  • Next by Date: GUI applescripting FreeHand MX
  • Previous by thread: Re: downloaded images and "Image Events"
  • Next by thread: Re: Using variables to target my own newly scriptable app
  • Index(es):
    • Date
    • Thread