• 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: 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


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

  • Prev by Date: Re: Using variables to target my own newly scriptable app
  • Next by Date: Re: Various Qs about Intel and AppleScript
  • Previous by thread: Re: Using variables to target my own newly scriptable app
  • Next by thread: GUI applescripting FreeHand MX
  • Index(es):
    • Date
    • Thread