• 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
Re: Using variables to target my own newly scriptable app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using variables to target my own newly scriptable app


  • Subject: Re: Using variables to target my own newly scriptable app
  • From: Philip Dow <email@hidden>
  • Date: Thu, 2 Feb 2006 19:45:13 +0100

Try this change to the second example:

tell application "Journler"
	tell active journal
		set anEntry to (the second entry)
		set the displayed entry of the last tab to anEntry
	end tell
end tell

That produces the error "Journler got an error: Can't make displayed entry of last tab of active journal into type reference." Offlist it was suggested I try "set anEntry to (get the second entry)", but that also did not work.


I have discovered something that does work:

tell application "Journler"
tell active journal
set anEntry to entry id 2 -- rather than "set anEntry to the second entry"
end tell
set the displayed entry of the last tab to anEntry
end tell


When setting the variable, if I refer to the entry by its unique identifier rather than its place in a list of entries, the script executes fine and produces the desired result. The question is then, of course, why should referring to the variable by unique id work when referring to it by place in a list does not. I should be dealing with the same object, right?

-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


References: 
 >Using variables to target my own newly scriptable app (From: Philip Dow <email@hidden>)
 >Re: Using variables to target my own newly scriptable app (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Using variables to target my own newly scriptable app
  • Next by Date: Re: Using variables to target my own newly scriptable app
  • Previous by thread: Re: Using variables to target my own newly scriptable app
  • Next by thread: Re: Using variables to target my own newly scriptable app
  • Index(es):
    • Date
    • Thread