Jump to content
Sign in to follow this  
patgenn123

Capture text from a field

Recommended Posts

patgenn123

Hello everyone!

I just recently found your program and am very excited to learn its capabilities and functionality. Please forgive me if this topic has already been discussed. I tried to look for it, but sometimes the topic title might hide the real question forum users ask.

If someone could direct me to the topic or give me a hint as to how to do this. I have not tried it myself yet, but I really just want a hint. Nothing more nothing less.

I would like to have a script constantly monitor a change in a database field. The moment that the field changes, run some other application. I would like this monitoring apply ONLY to that database and ONLY to that field.

Can AUTOIT do something like this?

Thanks!

-P

Share this post


Link to post
Share on other sites
zackrspv

Hello everyone!

I just recently found your program and am very excited to learn its capabilities and functionality. Please forgive me if this topic has already been discussed. I tried to look for it, but sometimes the topic title might hide the real question forum users ask.

If someone could direct me to the topic or give me a hint as to how to do this. I have not tried it myself yet, but I really just want a hint. Nothing more nothing less.

I would like to have a script constantly monitor a change in a database field. The moment that the field changes, run some other application. I would like this monitoring apply ONLY to that database and ONLY to that field.

Can AUTOIT do something like this?

Thanks!

-P

Sure it can :)

Tho it does depend on what type of database you are using.

But, I would think that in either case, you would simply create a function which executes the 'query' every 5 or 10 seconds (or whatever time you want), and if the contents change, execute another function to handle the change.

Shouldn't be too complex :(

Searches:

---->MySQL: http://www.autoitscript.com/forum/index.ph...14&hl=mysql

---->SQLLite: http://www.autoitscript.com/forum/index.ph...&hl=SQLLite

Should give you some good starts.

Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
patgenn123

Thank you! You know I have been on some other forums before, but I have never seen the response speed this fast. WOW! Thank you for giving me great enthusisam!

To follow up on your response, where do I go with this? i just need some direction. I will put something together then I will submit it for review.

This is awesome!

I am very excited! By the way, I am using ACT! 9.X. Just trying to automate it a little more without having to buy other addons. Also, trying to learn myself.

-P

Share this post


Link to post
Share on other sites
zackrspv

Thank you! You know I have been on some other forums before, but I have never seen the response speed this fast. WOW! Thank you for giving me great enthusisam!

To follow up on your response, where do I go with this? i just need some direction. I will put something together then I will submit it for review.

This is awesome!

I am very excited! By the way, I am using ACT! 9.X. Just trying to automate it a little more without having to buy other addons. Also, trying to learn myself.

-P

*scratches head*

ACT! 9.x huh; hum, i'm not too familiar with that product, especially not as a standard database program. Does it even support remote SQL commands (i'm not sure it does). If it is what I think it is, it is a Customer Relations Management platform (CRM); which would mean, that while it does have remote support to other users of ACT 9.x, it probably doesn't have any external addon support.

My question to you is, will you have this Act 9.x program open all the time for monitoring? If so, it may be possible to HOOK onto the application, and tell autoit where to MONITOR for that field change.

Tho, i think this may be way to far out of my league to even answer........*summons the mighty MVP's*

Edited by zackrspv

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
patgenn123

OK. It looks like i shouldn't have asked my question since you updated your response.

I tried to read through some of the info in those links. Foggy...real foggy. I know the database has an SDK, but in order to access or manipulate any info you need Visual Studio. i don't have it.

Is there any way of monitoring the change on the surface of the program? In other words, can I look at the data field as a control and constantly monitor it for a change in value instead of going inside?

-P

Share this post


Link to post
Share on other sites
zackrspv

OK. It looks like i shouldn't have asked my question since you updated your response.

I tried to read through some of the info in those links. Foggy...real foggy. I know the database has an SDK, but in order to access or manipulate any info you need Visual Studio. i don't have it.

Is there any way of monitoring the change on the surface of the program? In other words, can I look at the data field as a control and constantly monitor it for a change in value instead of going inside?

-P

Never give up man! ever! Auto.IT is pretty darned good at what it does. Just give it more time for someone OTHER than me to answer lol

But yes, you can monitor windows, etc, with the Window Managment section in the help file and the Controls section within that area too.

Both of these sections will tell you how you can interact with other windows porgrams, and the controls section will show how you can interact with specific controls on those windows.

But, i'm sure an MVP can give you other ideas too :)


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
patgenn123

zachrspv,

This is great! Thanks for directing me. I know I should have looked around a little more(I hope I don't get in trouble for asking and not putting up at least a half-hearted attempt).

I will look it up and give it a try.

Thanks for your help!

I will get back with you(and everyone else)

-P

Share this post


Link to post
Share on other sites
zackrspv

zachrspv,

This is great! Thanks for directing me. I know I should have looked around a little more(I hope I don't get in trouble for asking and not putting up at least a half-hearted attempt).

I will look it up and give it a try.

Thanks for your help!

I will get back with you(and everyone else)

-P

Ha, you won't get in trouble here. Just don't ask for someone to do it for you haha. Give it a go, the examples in the help files are pretty indepth and include whatever you need (most of the time), and if it doesn't work, just post back here with what you THINK it SHOULD do, and what it ACTUALLY did lol, and i'm sure many people here could help ya :)


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
Zedna

Your question is too vague.

My advice:

- post some screenshots of windows you want to automatize

- use Au3Info.exe to observe kind of controls used inside your target application

Share this post


Link to post
Share on other sites
patgenn123

Thanks Zedna.

I have included an attachment with screen shot.

I want to stress my total lack of knowledge of AutoIt. This is my first try at this. Handle with Care!

I moved the "FINDER TOOL" over the Contact Field(the field next to the "Contact label". Nothing came up in the

>>>> Control <<<< section next to the Text: area. However, if you look down at the very bottom, you can see the name "John Does".

To summarize: I would like the script to run on a periodic schedule(1 to 3 seconds) and capture the "text field" next to the "Contact" label

By the way, i am trying to upload the Word doc with the screenshot and it's telling me the upload falied. The file was larger than the available space. It's only a screen shot file.

-P

Share this post


Link to post
Share on other sites
patgenn123

This time it worked. Attached is the screen shot.

-P

Doc1.doc

Share this post


Link to post
Share on other sites
Zedna

This time it worked. Attached is the screen shot.

-P

This application doesn't use standard windows controls.

So you can't use AutoIt's Controlxxx() functions in this case.

You must use Send() or ControlSend() or MouseClick() to simulate exact keyboard/mouse working with your target app.

But as somebody said the best solution will be to directly open/read database file in this case.

What database type is it? Does this application use its own database format or use some standard one (Acces,FoxPro, etc)?

Share this post


Link to post
Share on other sites
zackrspv

This application doesn't use standard windows controls.

So you can't use AutoIt's Controlxxx() functions in this case.

You must use Send() or ControlSend() or MouseClick() to simulate exact keyboard/mouse working with your target app.

But as somebody said the best solution will be to directly open/read database file in this case.

What database type is it? Does this application use its own database format or use some standard one (Acces,FoxPro, etc)?

IIRC ACT 9.x is proprietary; tho, i do know there is an SDK for it.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
zackrspv

IIRC ACT 9.x is proprietary; tho, i do know there is an SDK for it.

Been reading up on the SDK, and if the framework supports COM object requests via iDispatch (I don't have Act 9.x installed, so i can't test for sure), it may be possible to interact via the framework. From the SDK:

// filter to just return string fields on a Contact

ContactFieldDescriptor[] fields =

framework.Contacts.GetContactFieldDescriptors(new Type[]{typeof(string)});

// we're going to look for editable fields that don't allow empty values

// and don't have default values, so we'll need these attribute types

Type allowsEmptyType = typeof(AllowEmptyFieldAttribute);

Type defaultValueType = typeof(DefaultFieldValueAttribute);

// initialize our attributes

AllowEmptyFieldAttribute allowsEmptyFieldAttr = null;

DefaultFieldValueAttribute defaultFieldAttr = null;

AttributeCollection attributes = null;

ContactFieldDescriptor contactField = null;

for (int i=0;i<fields.Length; i++)

{contactField = fields;

// make sure we can modify this field

if ( !contactField.IsReadOnly )

{attributes = contactField.Attributes;

// check if we don't all empty values

allowsEmptyFieldAttr = attributes[allowsEmptyType] as

AllowEmptyFieldAttribute;

if ( allowsEmptyFieldAttr != null && !allowsEmptyFieldAttr.AllowEmpty )

{

// now check to see we don't have a default value

defaultFieldAttr = attributes[defaultValueType] as

DefaultFieldValueAttribute;

if ( defaultFieldAttr == null || defaultFieldAttr.DefaultValue == null

){

// we found one

Console.WriteLine(contactField.DisplayName);

}}}}

That bolded part looks like a typical COM request, so it may be possible. Is ACT 9.x freely down loadable to test w/? If not, you may want to run the OLE/COM viewer from Microsoft to see if there are any objects you CAN interact with; but so far, it looks promising.

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
zackrspv

Been reading up on the SDK, and if the framework supports COM object requests via iDispatch (I don't have Act 9.x installed, so i can't test for sure), it may be possible to interact via the framework. From the SDK:

That bolded part looks like a typical COM request, so it may be possible. Is ACT 9.x freely down loadable to test w/? If not, you may want to run the OLE/COM viewer from Microsoft to see if there are any objects you CAN interact with; but so far, it looks promising.

By looking at the CHM included w/ the SDK, it looks like they are standard type libraries:

GetAllowedUserCount( )
LogOff ( )
LogOn ( System.String, System.String, System.String )

Example:

Dim xmlPADFile As String
Dim userName As String
Dim password As String
xmlPADFile = "C:\Documents and Settings\All Users\Documents\ACT\ACT for Win 7\Databases\ACT7Demo.PAD"
userName = "Chris Huffman"
password = ""
ActFwk.LogOn(xmlPADFile, userName, password)

Note, the above is in VB, it would have to be adapted with Autoit, but still, looks pretty much like this can be handled. What do our MVP's think?


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
zackrspv

I just recently found your program and am very excited to learn its capabilities and functionality. Please forgive me if this topic has already been discussed. I tried to look for it, but sometimes the topic title might hide the real question forum users ask.

Do you think you could run this code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>

$COM = GUICreate("COM Objects", 400, 900)
$list = GUICtrlCreateListView("COM Objects", 0, 0, 399, 899, $LVS_SORTASCENDING)
_GUICtrlListView_SetColumnWidth(-1, 0, 377)
GUISetState()

$c = 0
While 1
    $c += 1
    $text = RegEnumKey("HKLM\Software\Classes\CLSID", $c)
    If @error = -1 Then ExitLoop
    $data = RegRead("HKLM\Software\Classes\CLSID\"&$text&"\VersionIndependentProgID", "")
    If $data = "" Then
    Else
        If StringInStr($data, "ACT", 0, 1) Then GUICtrlCreateListViewItem($data, $list)
    EndIf
WEnd

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

And let me know if there are any COM objects returned for you? Most notably anything with ACT in it should be sufficient. The whole test is to see if any of those are QUICKLY available. One would still need to use the OLE Viewer to ensure they support iDispatch, but it may be worth a shot.


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
patgenn123

Thanks guys. Seems like I'm way over my head and I don't want to be the spectator, but I have no idea what you're doing.

Zackerspv, I ran the code, and it's not getting the contact name.

So capturing it on screen won't work? Why? It appears like AUTOIT knows that it's there, right?

It's under >>>>visible text<<<<< Is there a way of getting it from there?

Simply speaking, could a timer every 1 or 2 seconds trigger the control(invisibly) to capture what's visible on the screen and pull the contact name(from the >>>visible text<<< area) and put it in the clipboard?

I have to admit I am very green to any kind of programming. I am sorry for making you do all this work and not being able to compensate you. can I? Would that be allowed?

-P

Edited by patgenn123

Share this post


Link to post
Share on other sites
zackrspv

Thanks guys. Seems like I'm way over my head and I don't want to be the spectator, but I have no idea what you're doing.

Zackerspv, I ran the code, and it's not getting the contact name.

So capturing it on screen won't work? Why? It appears like AUTOIT knows that it's there, right?

It's under >>>>visible text<<<<< Is there a way of getting it from there?

Simply speaking, could a timer every 1 or 2 seconds trigger the control(invisibly) to capture what's visible on the screen and pull the contact name(from the >>>visible text<<< area) and put it in the clipboard?

I have to admit I am very green to any kind of programming. I am sorry for making you do all this work and not being able to compensate you. can I? Would that be allowed?

-P

Heya, that code wasn't suposed to monitor the field.

Run this code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>

$COM = GUICreate("COM Objects", 400, 900)
;~ $list = GUICtrlCreateListView("COM Objects", 0, 0, 399, 899, $LVS_SORTASCENDING)
$list = GUICtrlCreateEdit("", 0, 0, 399, 899)
_GUICtrlListView_SetColumnWidth(-1, 0, 377)
GUISetState()

$c = 0
While 1
    $c += 1
    $text = RegEnumKey("HKLM\Software\Classes\CLSID", $c)
    If @error = -1 Then ExitLoop
    $data = RegRead("HKLM\Software\Classes\CLSID\"&$text&"\VersionIndependentProgID", "")
    If $data = "" Then
    Else
        If StringInStr($data, "ACT", 0, 1) Then GUICtrlSetData($list, $data & @CRLF, GUICtrlRead($list))
    EndIf
WEnd

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

It will display an EDIT box with all of the COM objects which have ACT in their name. I'd like you to copy all of that, and paste it here. What i'm trying to see is if there is COM object support, or if we have to do it via screen capture (which is far more unreliable).


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
patgenn123

Here it is:

DataCtl.DataCtl

AMOVIE.ActiveMovieControl

Microsoft.ActiveXPlugin

SCActiveBlock.SpywareBlock

MoneySide.Factory

MSTIME.SMILAnimCompSiteFactory

MSTIME.TIMEFactory

DIACTFRM

NMPCDvdPlugin.NMPCDvdContentHandlerFactory

WMSDKNamespace.NamespaceFactory

ReportBuilderAddIn.ReportMetadataCtrl

BDATuner.MPEG2TuneRequestFactory

PeerFactory.PeerFactory

MSTIME.SMILAnimDefaultCompFactory

FPerson.Factoid

RcdUtil.ExtractCab

TIME.MMFactory

Ietag.Factory

HHActiveX.HHComponentActivator

USPInt.USPIntFactory

Pfcom.OmgPfFactory

Shell.ThumbnailExtract.GdiPlus.1

TIME.TIMEFactory

FStock.Factoid

MSSOAP.ConnectorFactory

GoogleDesktopSearch.EventFactory

TxCTx.TransactionContextEx

Zb_ui.ZbUiActivityDlg

GoogleDesktop.EmailDefaultActions

MOFL.Factoid

MSInfo.MSALFactory

TxCTx.TransactionContext

Mmcshext.ExtractIcon

ZbLocalVolumeDevice.DmvExtractIcon

BehaviorFactory.Microsoft.DXTFilterFactory

GoogleDesktop.ActionRegistration

FName.Factoid

MemStick.MemStickAttributeFactory

ActEmail.aAct7EmailConnector

Zb.ZbSelectActionDlg

RDSServer.DataFactory

HHActiveX.GlossaryPane

MSSOAP.SoapTypeMapperFactory

Shell.ThumbnailExtract.DocFile.1

ZbDmu.DmuExtractImageProperties

DIACTFRM

MsoRun.IETimeBehaviorFactory

MsoRun.IEAnimBehaviorFactory

GoogleDesktop.SsdClassFactory

OmgMp4LibWrapper.OmgMp4LibWrapFactory

OmgPdLocker.OmgPdLockFactory

LinkDataWrapper.Activities

ZbTaskCamerawindow.ZbCWActionHandler

JobObjIOActgInfoProv.JobObjIOActgInfoProv

FDate.Factoid

FlashFactory.FlashFactory

MSMQ.MSMQTransaction

MSMQ.MSMQCoordinatedTransactionDispenser

MSMQ.MSMQTransactionDispenser

Shell.ThumbnailExtract.HTML.1

COMSVCS.ActivityUnmarshal

COMSVCS.TransactionUnmarshal

COMSVCS.NonRootTransactionEnvoy

CFAct.CFAct

ObjPoolAct.ObjPoolAct

CtorAct.CtorAct

SoapAct.SoapAct

RCActiveXSetup.RCSetup

FPlace.Factoid

DWUpdateService.ActivityLog

Thanks!

Pat

Share this post


Link to post
Share on other sites
zackrspv

Here it is:

ActEmail.aAct7EmailConnector

CFAct.CFAct

ObjPoolAct.ObjPoolAct

CtorAct.CtorAct

SoapAct.SoapAct

RCActiveXSetup.RCSetup

Hum, i'm a bit concerned there. Do me a favor, and run this code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiListView.au3>

$COM = GUICreate("COM Objects", 400, 900)
$list = GUICtrlCreateEdit("", 0, 0, 399, 899)
_GUICtrlListView_SetColumnWidth(-1, 0, 377)
GUISetState()

$c = 0
While 1
    $c += 1
    $text = RegEnumKey("HKLM\Software\Classes\CLSID", $c)
    If @error = -1 Then ExitLoop
    $data = RegRead("HKLM\Software\Classes\CLSID\"&$text&"\VersionIndependentProgID", "")
    If $data = "" Then
    Else
        GUICtrlSetData($list, $data & @CRLF, GUICtrlRead($list))
    EndIf
WEnd

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

This code will list ALL objects on your computer, so it will be quite long. Please let me see the entire list and maybe, just maybe they didn't name them as ACT lol


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×