Page 1 of 1

Snapshot of a desktop browser

Posted: Sun Jan 18, 2015 7:04 pm
by Traxgeek
Hi,
Wondering if someone can help me here please ?

I'm trying to take a snapshot of a browser window. On mobile I use the format :

Code: Select all

. . .
      mobileControlSet nBID, "rect", the rect of image "imgBrowser" of group "grpBrowser"
      mobileControlSet nBID, "url", sURL
. . .
and

Code: Select all

export snapshot from rect sTheRectOfTheBrowserImageControl to file (sFilePath & "/" & sFileName) as jpeg
which works perfectly for anything WITHIN my app - both mobile (and desktop in fact - as long as the browser control is within my app).

However, on Desktop platforms I use the

Code: Select all

 launch url sURL
code line to fire up the default browser...

Is there a way to grab a screenshot of the contents of this browser window ? I have no idea how to reference it....

Any thoughts, or maybe, there's a better way / I shouldn't be using an external browser at all... ? ? ? I do hope someone can give me a kick in the right direction please.

Thanks a mil - as always !

Regards,
Trax

Re: Snapshot of a desktop browser

Posted: Sun Jan 18, 2015 7:31 pm
by Klaus
Hi Trax,
Traxgeek wrote:Is there a way to grab a screenshot of the contents of this browser window ?
not from within Livecode, I'm afraid!

Maybe you you can create an AppleScript on the Mac, who knows!? :D
No idea about Win and VBScript or something...


Best

Klaus

Re: Snapshot of a desktop browser

Posted: Mon Jan 19, 2015 8:46 am
by Traxgeek
Thanks Klaus.
Saved me banging my head against the wall for hours again ! Thanks a million.
Regards,
Trax

Re: Snapshot of a desktop browser

Posted: Mon Jan 19, 2015 12:11 pm
by Dixie
Hi...

You can grab a screenshot of the visible content of a 'browser' built within your stack by using export snapshot...

Re: Snapshot of a desktop browser

Posted: Tue Aug 18, 2015 8:17 am
by ramav
Hi Traxgeek:
I cannot even get the browser screen capture within my mobile app to work. Could you please provide some more details for your code snippets, specifically
mobileControlSet nBID, "rect", the rect of image "imgBrowser" of group "grpBrowser"
....
export snapshot from rect sTheRectOfTheBrowserImageControl to file (sFilePath & "/" & sFileName) as jpeg
.....

Does sTheRectOfTheBrowserImagecontgrol refer to the rect of image "imgBrowser" of group "grpBrowser"? Specifically, what does it expand to? Am I missing something? Thanks a bunch in advance...

Re: Snapshot of a desktop browser

Posted: Mon May 23, 2016 1:20 pm
by MaxV
This works:

Code: Select all

import snapshot from rectangle (the rect of widget "browser")
however use it correct window/widget coordinates