How to take a screenshot of a local folder's context menu?

Asked by ginger

The steps I did is:
1. create a new folder "newone" under c:\,
2. right click folder "newone", the context menu will pop up, select "copy" at the context menu

I want to take a screenshot of the "copy" item by Sikuli. But seems it doesn't work. How can I do with this issue?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Theodotos Andreou
Solved:
Last query:
Last reply:
Revision history for this message
Best Theodotos Andreou (theodotos) said :
#1

For Windows Vista and Win 7 you can use the included Snipping Tool:

http://en.wikipedia.org/wiki/Snipping_Tool

There is also a 3rd party application which has some more functionality called Greenshot:

http://getgreenshot.org/

Revision history for this message
ginger (ginger-jiang83) said :
#2

Thanks Theodotos Andreou, that solved my question.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

normally the Sikuli capture hotkey should work

Have the Sikuli IDE open, prepare your screen situation and press the hotkey. You should be able to capture something and it will be inserted at the current cursor position of the IDE.

But even if you succeed, using images of menu entries to click them might be a giant's work ;-)

I always look for shortcut options to solve things like that.

In your case might be easier having the new folder selected, just typing strg-c and strg-v.
type("c", KEY_CTRL); wait(0.5)
type("v", KEY_CTRL); wait(0.5)

Handling things like menu entries will be much easier in the upcoming Sikuli X (as a christmas present ;-), since you will be able to search for text in a region (in this case look for the text "Copy" in the region of the context menu).

Revision history for this message
Chris (izanagi-xiii) said :
#4

Some combinations of keys will close the context menus. (i.e if ALT is used)
I use "CTRL + SHIFT + 2" as a capture key - this seems to leave them open.

Alternatively you could set your 'Delay before capture' higher (under preferences) - This will let you click the Take screenshot button then set up the view before it freezes the screen.

Revision history for this message
SkaiCloud (flypilot43) said :
#5

That's pretty clever chris, it so obvious I never really thought about delayinging the capture in the preference menu. There were countless of time i need to copy an image of a menu only to have it disappear before the screen capture kicks in.

Revision history for this message
ginger (ginger-jiang83) said :
#6

Thanks for your helpful answer. :)
I solved it by capture the image first, then use find(imgpath) method to find it and click it.

Revision history for this message
MR HSNNN (lastreaction) said (last edit ):
#7

Capturing a screenshot of a context menu, like the one that appears when you right-click a folder and select "copy," can pose challenges in Sikuli.
To address this, you can introduce a brief delay before taking the screenshot to allow the context menu to fully appear. This can be achieved with the wait() function, specifying a short delay period such as one second.
Additionally, instead of targeting just the "copy" item, consider capturing a slightly larger area that encompasses the entire context menu. This approach increases the likelihood of successfully capturing the "copy" item. By incorporating these strategies, you can improve the effectiveness of capturing context menus in Sikuli. You can also use snipping tools as well such as https://screenpixel.org/