[IDE Script] Sublocation for a window ?

Hi Group,

in an IDE script, I want to get all items in a window. it seems the “sublocation” command can only give the result for a module or a folder.
is there a way to get the content of a selected window in the IDE ?


Unfortunately I don’t think there’s any way to enumerate the parts of an object. I’ve battled this in the past, coming to that conclusion, but would be overjoyed to be proven wrong. Seems a glaring oversight.

A possible workaround is to shell out to an app which opens the project, parses it, and returns the part names.

IDE script was never meant or designed for the things people are trying to use it for.
It’s initial goal was mostly to be able to automate some manual tasks - which is why the API for it is the way it is and remains.

There are FR’s relating to enhancing its ability to traverse a project and elements in project items.

I’ve also asked a few times what sort of purposes people are trying to make of IDE script that this sort of capability is needed.
I usually dont get a response

[quote=313934:@Norman Palardy]I’ve also asked a few times what sort of purposes people are trying to make of IDE script that this sort of capability is needed.
I usually dont get a response[/quote]
I want to change all the captions and texts in the window items to constants. I’ve done it actually with copy-paste to an external app and I was trying to do it more easier and integrated into the IDE with scripts, but as it is not possible it will stay as an external app.
it was one of my feature request of september : <https://xojo.com/issue/45102>

I recall seeing that request

suppose you have a window like this :

you select all items, copy and go to the application

clic on the first top button, and your items are parsed

then you clic on the second button, go back to xojo, delete the items and paste you get this

then you go back to the app, clic the third button, paste into xojo window, and you get the dynamic constants

all your items are transformed into dynamic constants, ready to translate with lingua

hope you like the demo !

Jean-Yves, nice demo. Does it work already?

You know about Arbed’s ability to find ALL strings and turn them - with user confirmation - into dynamic strings, right? Just asking.

yes it works, I had to make it for an app I have to translate, with complex windows with lots of items … so a huge work to do by hand.
does arbed do this for captions of windowitems, headers of listboxes, content of popupmenus ? or only strings .

Arbed does it for anything that can be a text, be it strings in source code or control items. You can even try it out how it works for free in Arbed - only if you want to actually have Arbed write back the converted project you’ll need to purchase a license.

See also: http://www.tempel.org/RB/Localization

well I should have known that before :wink:
it costed me more then $89 in time to do it, but hey, it was very instructive and now I know how to do it !
thanks, Thomas.