• 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: Now I can't get this terminology right, dammit!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Now I can't get this terminology right, dammit!


  • Subject: Re: Now I can't get this terminology right, dammit!
  • From: Brian Christmas <email@hidden>
  • Date: Fri, 03 Oct 2014 15:35:54 +1000

G'day Ron.

Thanks heaps for helping, and the concrete examples, but it's not working for me.

One thing I've learnt from your example tho, is that two bindings are required. I presume the theScrollView is to the first layer, Scroll View - Text View (mine is theNewColorsScrollView, and the theTextView is to the third layer, Text View (mine is theNewColorsView).

I had no idea from my reading that a second binding was a requirement. Shane's got me by the short & curlies with trying to decipher his suggestions, nothing I've tried has worked.

Shane's Explorer strips any pipes from 'origin'.

My code (from yours)…

set currentScrollPosition to the theNewColorsScrollView's contentView()'s |bounds|()'s origin()


tell theNewColorsView to scrollPoint_(currentScrollPosition)

I still get an error 'variable currentScrollPosition is not defined'.

Regards

Santa



On 03/10/2014, at 3:01 PM, Ron <email@hidden> wrote:


Brian,
I built a small sample app that just has a TextView in it, with associated ScrollView.
Here's code that shows how to do the translation, and it seems to work fine in this simple app:

property theScrollView : missing value
property theTextView : missing value

....

on applicationDidFinishLaunching_(aNotification)

repeat with i from 1 to 40
  tell theTextView to insertText_("This is some new text..." & return)
end

-- NSPoint currentScrollPosition=[[theScrollView contentView] bounds].origin;

set currentScrollPosition to the theScrollView's contentView()'s |bounds|()'s |origin|()

-- [[theScrollView documentView] scrollPoint:currentScrollPosition];

tell theTextView to scrollPoint_({0,0}) -- scrolls to the top (for testing next line)

tell theTextView to scrollPoint_(currentScrollPosition) -- scrolls to the bottom

end applicationWillFinishLaunching_



• Ron





On 2 Oct 2014, at 10:43 PM, 

No problem, Brian. I'll muddle through this a bit more tomorrow and get back to you.
I agree, ASObjC is a pain. That's why I do all my work in straight Objective C, where I have a real compiler and debugger to assist me.

• Ron





On 2 Oct 2014, at 10:40 PM, 


G'day Ron

Thanks for your concrete example. Unfortunately it still generates the same error. However, your code is completely different from what I expected the correct code to be, so food for thought. 

I'm going to have to try and follow Shane's advice once again, but unfortunately when Shane uses terms like 'clue' and 'pretty obvious' he's speaking from someone who has this damn stuff running through his veins, whereas to me, those terms mean I'm once again going to have to group my way through a bloody blinding snow storm, usually without success.

It's no wonder that it seems very few people actually take up programming in ASObjC, there's so many hurdles! And so very, very few concrete examples of conversion.

Regards

Santa

On 03/10/2014, at 12:04 PM, Ron Reuter 

Right, you'll have to use contentView() because it is a method on a view, not a property of a view.
Do not post admin requests to the list. They will be ignored. applescriptobjc-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Fwd: Now I can't get this terminology right, dammit! (From: Ron <email@hidden>)

  • Prev by Date: Fwd: Now I can't get this terminology right, dammit!
  • Next by Date: Re: Now I can't get this terminology right, dammit!
  • Previous by thread: Fwd: Now I can't get this terminology right, dammit!
  • Next by thread: Fwd: Now I can't get this terminology right, dammit!
  • Index(es):
    • Date
    • Thread