get-menu, text includes filepath [message #1779698] |
Thu, 11 January 2018 06:25  |
Eclipse User |
|
|
|
From the recorder, the menu -path option is
get-view Console | get-button "Display Selected Console" | click -arrow
get-menu
-path "5 testShader_shader_simulator [Renesas Shader Simulator Debugging] C:\\/testeagl\\/Renesas\\/DebugComp\\/imp_x5-elf-gdb.exe -shader-core=2 (7.10.1)"
| click
As this contains my test folder, to be portable the script needs to build this dynamically. I've been able to read the path OK, from another property, but not use it subsequently in the get-menu call. Possibly it is lacking the \\ tags.
I've attached the script and some show-alert screenshots.
Capture: $binpath
Capture1: $gdbmenu
Capture2: Error message from get-menu $gdbmenu
Capture3: AUT showing menu
One useful feature would be to access menu items by their raw index (my understanding of the current -index option is that it is only valid in the case where menu entries are repeated, requiring a -path and -index). For example here, get-menu -rawindex 4 would obtain the fifth item. Alternatively a -contains option allowing partial string match (AFAIK the -path has to be an exact, full, match?)
|
|
|
Re: get-menu, text includes filepath [message #1780380 is a reply to message #1779698] |
Sun, 21 January 2018 23:21  |
Eclipse User |
|
|
|
Hi Andrew,
1) try to add 'invoke replaceAll "/" "\\\\/"' command after 'concat' command, like this:
let [val gdbmenu [concat "5 testShader_shader_simulator [Renesas Shader Simulator Debugging] " $binpath | invoke replaceAll "/" "\\\\/"]]{
2) to get menu item by a partial string, use 'get-menu -path ".*menu-item-name.*"'
to get item by index use 'get-menu -path ".*" -index 2' (is possible in RCPTT 2.3.0 nightly)
|
|
|
Powered by
FUDForum. Page generated in 0.26046 seconds