Notifications
Clear all

[Closed] Accesing to Motion Panel text boxes

Hi there,
I need to type values in the motion panel textboxes, but since there isnt any parameters for it… i dont know how.

Thanks to denisT for this, to press button:


  if (hwnd = windows.getChildHWND #max "Collapse") != undefined do UIAccessor.PressButton hwnd[1]

Thanks!

14 Replies

that’s more correct actually:


windows.getchildhwnd (windows.getchildhwnd #max "Command Panel")[1] "Collapse"

2 Replies
(@leviatan1001)
Joined: 11 months ago

Posts: 0

Aha, but do you know if its possible to send values to those textboxes?

(@denist)
Joined: 11 months ago

Posts: 0

sure… you can send any message to any window.

And how, please? ^^

where do you want to send the message? what do you want to change?

Start time, End time and samples.

 lo1

I have yet to find a working implementation of changing text in a spinner’s value field using messages. I tend to resort to using dotnet sendkeys for those purposes. Would welcome any input as well.


  fn setTrajectorySampleRange start: end: samples: convert:on = 
  (
  	fn editValue hwnd val = 
  	(
  		WM_CHAR 	= 0x0102
  		VK_RETURN 	= 0x000D
  
  		uiaccessor.setwindowtext hwnd val
  		windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
  	)	
    
  	local task_hwnd = for c in (windows.getchildrenhwnd (windows.getchildhwnd #max "Command Panel")[1]) where c[4] == "MotionTask" do exit with c[1]
  	if task_hwnd != undefined do
  	(
  		-- first 3 (start, end, samples) -- 4th object's name
  		local edits = for c in (windows.getchildrenhwnd task_hwnd) where c[4] == "Edit" collect c[1]
  		
  		if start 	!= unsupplied do editValue edits[1] (start as string)
  		if end 		!= unsupplied do editValue edits[2] (end as string)
  		if samples 	!= unsupplied do editValue edits[3] (samples as string)
  		
  		local convert_to = (windows.getchildhwnd task_hwnd "Convert To")[1]
  		if convert do uiaccessor.pressbutton convert_to
  	)
  )
  /*
  setTrajectorySampleRange start:10 end:80 samples:2
  setTrajectorySampleRange start:20 end:70 samples:3
  */
  
 lo1
fn editValue hwnd val = 
  	(
  		WM_CHAR 	= 0x0102
  		VK_RETURN 	= 0x000D
  
  		uiaccessor.setwindowtext hwnd val
  		windows.sendMessage hwnd WM_CHAR VK_RETURN 0 -- press ENTER key
  	)

:bowdown: :bowdown: :bowdown:

Oh my god, whats that? xD Thank you man, ill check it tomorrow. Would you like to explain that witchcraft stuff you have made there? I dont understand anything xD

dude that’s pretty awesome…

Can you please show the correct way to “click” a checkbox, using the same method?
I’ve tried using the UIAccessor.PressButton, changing the key value to the spacebar; but could not actually change the state…

Page 1 / 2