Pb to get all children of an object under W10

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Pb to get all children of an object under W10

Paulber19
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

James Teh
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Paulber19
Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

derek riemer
You might be able to use obj.childCount. Note however that sighted people would have to quite possibly scroll to get that information anyway. The way NVDA gets the number of items in a folder should be consulted, namely, positionInfo

On Tue, Mar 14, 2017 at 2:38 AM, Paulber19 <[hidden email]> wrote:
Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.



Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




--

Derek Riemer: Improving the world one byte at a time!

  • University of Colorado Boulder Department of computer science, 4th year undergraduate student.
  • Accessibility enthusiast.
  • Proud user of the NVDA screen reader.
  • Open source enthusiast.
  • Skier.

Personal website



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Abdel
In reply to this post by Paulber19

Hi Paul,

Also, when I look at the number of folders and files in the explorer of my folder 'My documents', with Windows 8.1, I have only 27 elements when I use 'len(api.getFocusObject().parent.children)'.

My 'My Documents' folder normally contains 237 items in total.

However, the following instruction returns correctly the total number:

print api.getFocusObject().positionInfo.get('similarItemsInGroup')

Try and tell us if it works well with you.

Best regards,
Abdel.
Le 14/03/2017 à 09:39, Paulber19 [via NVDA] a écrit :

Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41729.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Paulber19
Hi Abdel,
Correct Abdel, I know it.
But I want to count the number of selected objects in the folder. with this code:
for item in api.getFocusObject().parent.children:
...
Same result with api.getFocusObject().parent.childCount.
Best regards.

Le 14/03/2017 18:21, Abdel a écrit :

Hi Paul,

Also, when I look at the number of folders and files in the explorer of my folder 'My documents', with Windows 8.1, I have only 27 elements when I use 'len(api.getFocusObject().parent.children)'.

My 'My Documents' folder normally contains 237 items in total.

However, the following instruction returns correctly the total number:

print api.getFocusObject().positionInfo.get('similarItemsInGroup')

Try and tell us if it works well with you.

Best regards,
Abdel.
Le 14/03/2017 à 09:39, Paulber19 [via NVDA] a écrit :

Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41729.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Abdel

OK Paul,

I understand.

I think it would be easier to retrieve these informations by looking at the last line of the Windows Explorer.

1. Open any folder in Windows Explorer.

2. Maximize the window.

3. Activate the screen review mode with NVDA + 7.

4. Shift numPad 9 to review the last line.

We have the total number of items and possibly the number of items selected.

It would be nice if in future versions of NVDA, this information could be retrieved in the status bar accessible with NVDA + End.

Best regards,
Abdel.


Le 14/03/2017 à 18:50, Paulber19 [via NVDA] a écrit :
Hi Abdel,
Correct Abdel, I know it.
But I want to count the number of selected objects in the folder. with this code:
for item in api.getFocusObject().parent.children:
...
Same result with api.getFocusObject().parent.childCount.
Best regards.

Le 14/03/2017 18:21, Abdel a écrit :

Hi Paul,

Also, when I look at the number of folders and files in the explorer of my folder 'My documents', with Windows 8.1, I have only 27 elements when I use 'len(api.getFocusObject().parent.children)'.

My 'My Documents' folder normally contains 237 items in total.

However, the following instruction returns correctly the total number:

print api.getFocusObject().positionInfo.get('similarItemsInGroup')

Try and tell us if it works well with you.

Best regards,
Abdel.
Le 14/03/2017 à 09:39, Paulber19 [via NVDA] a écrit :

Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41729.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41733.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Paulber19
Yes Abdel,
It's  right that the status bar of Windows Explorer give these informations, but I asked this issue with a add-on developper view.
Selected state was as sample.  Imagine search for  other state, name, role,....
I don't why we cannot get all the childs of an object under Windows 10 as we can get it under Windows XP.
Best regards.
Paul.

Le 14/03/2017 21:13, Abdel a écrit :

OK Paul,

I understand.

I think it would be easier to retrieve these informations by looking at the last line of the Windows Explorer.

1. Open any folder in Windows Explorer.

2. Maximize the window.

3. Activate the screen review mode with NVDA + 7.

4. Shift numPad 9 to review the last line.

We have the total number of items and possibly the number of items selected.

It would be nice if in future versions of NVDA, this information could be retrieved in the status bar accessible with NVDA + End.

Best regards,
Abdel.


Le 14/03/2017 à 18:50, Paulber19 [via NVDA] a écrit :
Hi Abdel,
Correct Abdel, I know it.
But I want to count the number of selected objects in the folder. with this code:
for item in api.getFocusObject().parent.children:
...
Same result with api.getFocusObject().parent.childCount.
Best regards.

Le 14/03/2017 18:21, Abdel a écrit :

Hi Paul,

Also, when I look at the number of folders and files in the explorer of my folder 'My documents', with Windows 8.1, I have only 27 elements when I use 'len(api.getFocusObject().parent.children)'.

My 'My Documents' folder normally contains 237 items in total.

However, the following instruction returns correctly the total number:

print api.getFocusObject().positionInfo.get('similarItemsInGroup')

Try and tell us if it works well with you.

Best regards,
Abdel.
Le 14/03/2017 à 09:39, Paulber19 [via NVDA] a écrit :

Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41729.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41733.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel
Reply | Threaded
Open this post in threaded view
|

Re: Pb to get all children of an object under W10

Abdel

Hi Paul,

I agree with you, with accessibility APIs, apparently, we can not have all the items if they are numerous.

I suggest you use the 'Shell.Application' object, which provides interesting properties and methods.

Here is a globalPlugins example tested with windows 8.1 and 10.

It is also attached.

# -*- coding:utf-8 -*-

import globalPluginHandler
import api
import speech
import controlTypes
from comtypes.client import CreateObject

class GlobalPlugin(globalPluginHandler.GlobalPlugin):

    def script_reportCurFolderSelection(self, gesture):
        fg = api.getForegroundObject()
        # We check if we are in the Windows Explorer.
        if fg.role != controlTypes.ROLE_PANE and fg.appModule.appName != "explorer":
            return
       
        # We create a variable to store the object of the Windows Explorer.
        curExp = None
        sh = CreateObject("shell.application")
        # We go through the list of open Windows Explorers to find the one that has the focus.
        for window in sh.Windows():
            if window.Document.Folder.Title == fg.name:
                curExp = window
        # The script doesn't work in the Windows Desktop.
        if not curExp:
            return
        # Now that we have the current folder, we can explore the SelectedItems collection.
        speech.speakMessage ("The current folder contains %d elements, %d items are selected" % (curExp.Document.Folder.Items().Count, curExp.Document.SelectedItems().Count))
        for selectedItem in curExp.Document.SelectedItems():
            speech.speakMessage ("Name: %s, type: %s, path: %s" % (selectedItem.name, selectedItem.type, selectedItem.path))

    __gestures={
        "kb:nvda+shift+numpad3":"reportCurFolderSelection"
    }

Best regards,
Abdel.


Le 14/03/2017 à 23:00, Paulber19 [via NVDA] a écrit :
Yes Abdel,
It's  right that the status bar of Windows Explorer give these informations, but I asked this issue with a add-on developper view.
Selected state was as sample.  Imagine search for  other state, name, role,....
I don't why we cannot get all the childs of an object under Windows 10 as we can get it under Windows XP.
Best regards.
Paul.

Le 14/03/2017 21:13, Abdel a écrit :

OK Paul,

I understand.

I think it would be easier to retrieve these informations by looking at the last line of the Windows Explorer.

1. Open any folder in Windows Explorer.

2. Maximize the window.

3. Activate the screen review mode with NVDA + 7.

4. Shift numPad 9 to review the last line.

We have the total number of items and possibly the number of items selected.

It would be nice if in future versions of NVDA, this information could be retrieved in the status bar accessible with NVDA + End.

Best regards,
Abdel.


Le 14/03/2017 à 18:50, Paulber19 [via NVDA] a écrit :
Hi Abdel,
Correct Abdel, I know it.
But I want to count the number of selected objects in the folder. with this code:
for item in api.getFocusObject().parent.children:
...
Same result with api.getFocusObject().parent.childCount.
Best regards.

Le 14/03/2017 18:21, Abdel a écrit :

Hi Paul,

Also, when I look at the number of folders and files in the explorer of my folder 'My documents', with Windows 8.1, I have only 27 elements when I use 'len(api.getFocusObject().parent.children)'.

My 'My Documents' folder normally contains 237 items in total.

However, the following instruction returns correctly the total number:

print api.getFocusObject().positionInfo.get('similarItemsInGroup')

Try and tell us if it works well with you.

Best regards,
Abdel.
Le 14/03/2017 à 09:39, Paulber19 [via NVDA] a écrit :

Hi,
Thanks James.
So, in this case, we cannot count, for exemple, all the selected items (visible or not) of a windows 10 's folder  by using obj.children .
Perhaps it(s legitimate but I think it's also  very restrictive.
Is there other solution?
Best regards.
Paul.


Le 14/03/2017 01:00, James Teh a écrit :
I'd say the control is choosing to only expose a subset of the items via accessibility APIs. This is entirely legitimate; such things can be done for performance and efficiency reasons.

On Tue, Mar 14, 2017 at 4:15 AM, Paulber19 <[hidden email]> wrote:
Hi,
I don(t understand why I cannot get all children of an object under Windos 10   by using "obj.children".
I get only a part of  the children. I think that is only visible children.
Under Windows XP, there is no problem.
I check it with Windows Explorer and I put the focus on an item in a folder with 118 items.
My code is:
obj = api.getFocusObject().parent
print len(obj.children)
The result is 31 under W10, 118 under WXP.
Why this difference between XP  and W10 ?
How can I get all the children under W10.
I tried  using UIA but with the same result.
Thanks for your help and Sorry for my very bad english.
Best regards.
Paul.





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41729.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41733.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


Best regards,
Abdel.


View this message in context: Re: Pb to get all children of an object under W10
Sent from the Development mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nvda-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nvda-devel



If you reply to this email, your message will be added to the discussion below:
http://nabble.nvda-project.org/Pb-to-get-all-children-of-an-object-under-W10-tp41727p41735.html
To start a new topic under Development, email [hidden email]
To unsubscribe from Development, click here.
NAML


reportSelection.py (1K) Download Attachment

Best regards,
Abdel.