Interfacing GUI applications..? 
Author Message
 Interfacing GUI applications..?

Hi,

I've been searching for a couple of days now and must resort asking for help...

Does anyone know if it's possible to interface to a GUI application via a python
script?  I'm writing an application and would like to invoke Adobe's AcroRead
(on Linux) and feed data to a "fill-in" PDF file.

The minimum requirement is to make AcroRead think it's coming from the
keyboard.  Extra points for mouse events (or shortcuts, though not all menus
items have shortcuts).

Many thanks for any pointers,
Pierre



Wed, 19 Nov 2003 05:03:42 GMT  
 Interfacing GUI applications..?


Quote:
>Hi,

>I've been searching for a couple of days now and must resort asking for help...

>Does anyone know if it's possible to interface to a GUI application via a Python
>script?  I'm writing an application and would like to invoke Adobe's AcroRead
>(on Linux) and feed data to a "fill-in" PDF file.

>The minimum requirement is to make AcroRead think it's coming from the
>keyboard.  Extra points for mouse events (or shortcuts, though not all menus
>items have shortcuts).

                        .
                        .
                        .
Is this AcroRead operating under Windows?  If so,
I think it will be useful to sharpen your question
to, "Does anyone know whether AcroRead is a COM
server?"  That question, incidentally, has nothing
to do with Python, and little to do with GUIs; the
folks in comp.text.pdf will more likely be of help
with that.

If you're operating under Windows (I speculate you
are), and if AcroRead is a COM server (I anticipate
that it is), then you're in luck; Python is a GREAT
language for COM scripting.

If not ... we'll try something else.

Incidentally, ReportLab might interest you.  'Any-
one out there have any user reports on ReportLab?
I've cobbled together some of my own PDF manipula-
tions, but I'll happily discard all of them for a
well-done package.
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Wed, 03 Dec 2003 07:19:04 GMT  
 Interfacing GUI applications..?

I muddied matters by mumbling:
Quote:


>>Hi,

>>I've been searching for a couple of days now and must resort asking for help...

>>Does anyone know if it's possible to interface to a GUI application via a Python
>>script?  I'm writing an application and would like to invoke Adobe's AcroRead
>>(on Linux) and feed data to a "fill-in" PDF file.

>>The minimum requirement is to make AcroRead think it's coming from the
>>keyboard.  Extra points for mouse events (or shortcuts, though not all menus
>>items have shortcuts).
>                    .
>                    .
>                    .
>Is this AcroRead operating under Windows?  If so,
>I think it will be useful to sharpen your question
>to, "Does anyone know whether AcroRead is a COM
>server?"  That question, incidentally, has nothing
>to do with Python, and little to do with GUIs; the
>folks in comp.text.pdf will more likely be of help
>with that.

>If you're operating under Windows (I speculate you
>are), and if AcroRead is a COM server (I anticipate
>that it is), then you're in luck; Python is a GREAT
>language for COM scripting.

>If not ... we'll try something else.

>Incidentally, ReportLab might interest you.  'Any-
>one out there have any user reports on ReportLab?
>I've cobbled together some of my own PDF manipula-
>tions, but I'll happily discard all of them for a
>well-done package.

                        .
                        .
                        .
I apologize to everyone whom I confused by failing to notice
Mr. Fortin's clear description of his use of Linux.  I'm ad-
justing my quality-control system.

Part of the conversation has been private.  I'll summarize:

No one believes (Linux) AcroRead is scriptable, although I
continue to fantasize someone will inform us to the contrary.

Usually what people mean when they ask for something like
this is a way to synthesize their own .PDF documents, based
on templates already at hand.  I'm considering writing an
article or two on the subject.  I'll put pointers at <URL:
http://starbase.neosoft.com/~claird/comp.text.pdf/PDF.html >.

Can Python "just" script GUI stuff, the way it does command-
line applications?  In general, no; X's model resists that
quite thoroughly, although those truly dedicated to the task
will like Android <URL:
http://starbase.neosoft.com/~claird/comp.windows.misc/Android.html >.
Applications built with specific toolkits--Tk, GTK+, ...--often
admit more convenient scripting, when adequate documentation
is also available.
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Sun, 07 Dec 2003 23:02:07 GMT  
 Interfacing GUI applications..?

[snip]

Quote:
> >The minimum requirement is to make AcroRead think it's coming from the
> >keyboard.  Extra points for mouse events (or shortcuts, though not all menus
> >items have shortcuts).

[snip]

Quote:
> If you're operating under Windows (I speculate you
> are), and if AcroRead is a COM server (I anticipate
> that it is), then you're in luck; Python is a GREAT
> language for COM scripting.

> If not ... we'll try something else.

One suggestion for "something else"... there is a Visual Basic function
"sendkeys()" that does exactly what is requested--it simulates keyboard
input to another application.  At one point I downloaded a COM object
that wrapped this function (plus ActivateApp(), IIRC) from Clarence
Washington's Windows scripting site (http://cwashington.netreach.net);
I would presume that the download is still available there.  Using this
COM object (from Python) lets me send simulated keystrokes to any Windows
app, and I believe that it also allows sending ctrl-keys as well.  Of course,
if the app you're interested in (AcroRead) *is* a COM server, then you'll
be much better off controlling it directly.  One word of warning--the
scripting site uses DHTML tricks, or some such, that crash Netscape upon
loading, so it may be necessary to use IE...

Quote:
> Incidentally, ReportLab might interest you.  'Any-
> one out there have any user reports on ReportLab?
> I've cobbled together some of my own PDF manipula-
> tions, but I'll happily discard all of them for a
> well-done package.

I'd be interested in hearing reviews/testimonials on ReportLab as well.  
Somewhere down near the bottom of my list of projects, I'm looking to
create PDF docs automatically.  At first glance, ReportLab looks ideal,
but reports of firsthand experiences are always good....

Jeff Shannon
Technician/Programmer
Credit International



Mon, 08 Dec 2003 01:12:18 GMT  
 Interfacing GUI applications..?

    ...

Quote:
> One suggestion for "something else"... there is a Visual Basic function
> "sendkeys()" that does exactly what is requested--it simulates keyboard

Easily usable from Python too (as it's packaged as part of the Windows
Scripting Host, a free download from Microsoft if you don't have it
already installed).  See an example, e.g., at:
http://aspn.activestate.com/ASPN/Python/Cookbook/Recipe/65107

Pity it won't help the original poster (who's on Linux) -- unfortunately,
generic scriptability under Unix-y systems tends to be horrible for all
non-text-mode applications (except, I'm told, those built with certain
clever toolkits -- no direct experience, sorry).  Ah, *COM*...!

Alex



Mon, 08 Dec 2003 03:03:22 GMT  
 Interfacing GUI applications..?

Quote:



>>Hi,

>>I've been searching for a couple of days now and must resort asking for help...

>>Does anyone know if it's possible to interface to a GUI application via a Python
>>script?  I'm writing an application and would like to invoke Adobe's AcroRead
>>(on Linux) and feed data to a "fill-in" PDF file.

Why does this need scripting? Isn't this solvable in a supported way
using FDF files?
----------------------------------------

Please support usenet! Post replies and follow-ups, don't e-mail them.


Mon, 08 Dec 2003 06:44:26 GMT  
 Interfacing GUI applications..?

Quote:




> >>Hi,

> >>I've been searching for a couple of days now and must resort asking for help...

> >>Does anyone know if it's possible to interface to a GUI application via a Python
> >>script?  I'm writing an application and would like to invoke Adobe's AcroRead
> >>(on Linux) and feed data to a "fill-in" PDF file.

> Why does this need scripting? Isn't this solvable in a supported way
> using FDF files?

Say what...?!  Are you suggesting I write code which generates hundreds of
values only to have to manually transcribe the results into a "fill-in" PDF
file...?  If so...  :^P

I am looking for a way to plug the results into a PDF file which is available
online (i.e, IRS forms).

Pierre

- Show quoted text -

Quote:
> ----------------------------------------

> Please support usenet! Post replies and follow-ups, don't e-mail them.



Mon, 08 Dec 2003 08:56:02 GMT  
 Interfacing GUI applications..?
For non-standard (older) windows applications that do not appropriately
respond to key-stroke instructions, take a look at mSched from
http://www.mjtnet.com/ .  I've just completed "automating" a windows app
with this, and found it more than up to the task.

--

Emile van Sebille

---------

Quote:


>     ...
> > One suggestion for "something else"... there is a Visual Basic function
> > "sendkeys()" that does exactly what is requested--it simulates keyboard

> Easily usable from Python too (as it's packaged as part of the Windows
> Scripting Host, a free download from Microsoft if you don't have it
> already installed).  See an example, e.g., at:
> http://aspn.activestate.com/ASPN/Python/Cookbook/Recipe/65107

> Pity it won't help the original poster (who's on Linux) -- unfortunately,
> generic scriptability under Unix-y systems tends to be horrible for all
> non-text-mode applications (except, I'm told, those built with certain
> clever toolkits -- no direct experience, sorry).  Ah, *COM*...!

> Alex



Mon, 08 Dec 2003 09:24:06 GMT  
 Interfacing GUI applications..?

Quote:

>> Why does this need scripting? Isn't this solvable in a supported way
>> using FDF files?

>Say what...?!  Are you suggesting I write code which generates hundreds of
>values only to have to manually transcribe the results into a "fill-in" PDF
>file...?  If so...  :^P

Where did I say anything about "manually transcribe"? Perhaps you do
not know how to open an FDF file in order to fill in a form.  Or
perhaps this does not work in *nix?
----------------------------------------

Please support usenet! Post replies and follow-ups, don't e-mail them.


Mon, 08 Dec 2003 16:16:53 GMT  
 Interfacing GUI applications..?

Quote:


> >> Why does this need scripting? Isn't this solvable in a supported way
> >> using FDF files?
           ^
> >Say what...?!  Are you suggesting I write code which generates hundreds of
> >values only to have to manually transcribe the results into a "fill-in" PDF
> >file...?  If so...  :^P

> Where did I say anything about "manually transcribe"? Perhaps you do
> not know how to open an FDF file in order to fill in a form.  Or
> perhaps this does not work in *nix?

Sorry, I missed the *F*DF (I read PDF); downloading the *nix SDKs now...

Pierre



Mon, 08 Dec 2003 22:04:01 GMT  
 Interfacing GUI applications..?

:
:> Incidentally, ReportLab might interest you.  'Any-
:> one out there have any user reports on ReportLab?
:> I've cobbled together some of my own PDF manipula-
:> tions, but I'll happily discard all of them for a
:> well-done package.
:
:I'd be interested in hearing reviews/testimonials on ReportLab as well.  
:Somewhere down near the bottom of my list of projects, I'm looking to
:create PDF docs automatically.  At first glance, ReportLab looks ideal,
:but reports of firsthand experiences are always good....

I've had limited experience with what's currently classified as a
"demo" application of ReportLab, PythonPoint.  It produces PDF from a
presentation language (which is just XML), and seems to do so
correctly. So far I'm happy with the quality... [[there was a problem
that cropped up with ReportLab 1.07 caused by Python 2.1's changing to
outputting literals in hex instead of octal, but there's a patch for
that or it may be fxed in the 1.08 release that was just announced]]

So... thumbs up from me.

Mats Wichmann

(Anti-spam stuff: to reply remove the "xyz" from the



Mon, 08 Dec 2003 22:45:07 GMT  
 Interfacing GUI applications..?

Quote:



>     ...
> > One suggestion for "something else"... there is a Visual Basic function
> > "sendkeys()" that does exactly what is requested--it simulates keyboard

> Pity it won't help the original poster (who's on Linux)

D'oh!  I guess that I, too, need to read a bit more carefully before spouting
off...  oops.  :)  

I do have to agree with what you've said before, though, Alex... however much
one may dislike Microsoft products in general, COM is really, really nice.

Now if only it could work transparently cross-platform.  <wink>

Jeff Shannon
Technician/Programmer
Credit International



Tue, 09 Dec 2003 00:17:24 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. HELP! Interfacing prolog application with MS-WINDOWS application

2. ** APS (GUI) opportunity ** APS (GUI) ** APS (GUI) Experience required

3. Can awk/sed/shell Interface with GUI?

4. FYI GUI site: Interface hall of shame

5. Building a GUI interface

6. I've got a Dos based GUI Interface

7. Logo Programming - GUI Interfaces

8. Logo Programming - GUI Interfaces

9. Alternate GUI interface? (newbie Q)

10. GUI Interface standards.

11. Rexx GUI interface for Windoze?

12. preferred GUI interfaces for Scheme

 

 
Powered by phpBB® Forum Software