randallc
-
Posts
434 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by randallc
-
-
Hi,
here's a non-guaranteed Word macro which calls the next NMEX3 macro at the end;
Sub fieldfind()'To do it simply, set this macro to a toolbar menu which you can get from MEx3
' by simple key presses; at the end, it will call your macro to continue
'and recover the strings from the registry entries you have made
' At least to give an idea.....
Dim MacEx3, strSection, strPicker, strDestination
strSection = "HKEY_CURRENT_USER\Software\Professional Grade Macros" _
& "\PGM Functions\Swap"
Selection.HomeKey Unit:=wdStory, Extend:=wdMove
ActiveDocument.Fields.Update
Do While Not (Selection.NextField Is Nothing)
fieldNumber = fieldNumber + 1
System.PrivateProfileString("", strSection, _
"Field" + fieldNumber) = Selection
'MsgBox (Selection)
Loop
MacEx3 = "c:\program files\macro express3\"
On Error Resume Next
Shell (MacEx3 + "meproc.exe /ARetrieverFromRegistryMacro")
End Sub
What do you think?
Randall
-
Hi,
I have successfully run macros in word which send info to MEX text strings.
If you can record a Word macro to record the info you want first, this could be run and the info sent?
I have not made a macro looking for field name content, but I bet it is possible.
Best, Randall
-
Hi,
So have you changed it back inIE?...
But maybe check the ie setting has not changed in tools/Internet Options/ advanced/ line 3 or 4 page 2 "reuse windows for launching shortcuts"Randall
-
no, i thought that was always so....
But maybe check the ie setting has not changed in tools/Internet Options/ advanced/ line 3 or 4 page 2 "reuse windows for launching shortcuts"
-
Good news and god luck!
Maybe post back later as extracting from a google search could be useful;;
Best, Randall
-
Hi,
Try this; also better implementation of similar in "WebEdit" link macro' link from my signature.
Best, randall
-
I suspect there would have to be a command built into each program ; eg MSoffice programs don't do that, do they?
Best, Randall
-
Hi,
Do you mean macro express?
Options/ Preferences/ Appearance/ click on "show in system tray"
Best, Randall
-
Hi,
Sorry,
Previous post i have uploaded corrected ""
EDIT; "{_Form3} corrected, replaced
Randall
-
Hi,
Yes, but those commands (as opposed to string setting) don't seem to need the "& Chr(01) "
(In script editor, just copy the "Set Decimal" command line into an editor or "Text type" screen) and you will see there is no "unusual" character near the end as opposed to "Set String"
Best, Randall
-
Hey, Good work!
Thanks for that.
If you only want 3 lines and want to name them and the title on the fly; try;
// Set Form TitleVariable Set String %T1% "My Title Whatever I Want"
Variable Modify String: Save %T1% to Environment Variable
// Set Field Label 1
Variable Set String %T1% "Field1 - Surname "
Variable Modify String: Save %T1% to Environment Variable
// Set Field Label 2
Variable Set String %T1% "Field2 - Firstname"
Variable Modify String: Save %T1% to Environment Variable
// Set Field Label 3
Variable Set String %T1% "Field3 - email"
Variable Modify String: Save %T1% to Environment Variable
// Run macro
Macro Run: {_Form3}
// Display or retrieve 3 fields
Repeat Start (Repeat 3 times)
Read Registry String: "FieldName%N1%"
Variable Modify String: Save %T1% to Environment Variable
Variable Modify String: Append "FieldName%N1% = " to %T2%
Variable Modify String: Append "%T1%%CRLF%" to %T2%
Repeat End
Text Box Display:
Best, Randall<REM2:Set Form Title ><TVAR2:01:01:My Title Whatever I Want><TMVAR2:19:01:00:000:000:Title><REM2:Set Field Label 1><TVAR2:01:01:Field1 - Surname ><TMVAR2:19:01:00:000:000:Field1><REM2:Set Field Label 2><TVAR2:01:01:Field2 - Firstname><TMVAR2:19:01:00:000:000:Field2><REM2:Set Field Label 3><TVAR2:01:01:Field3 - email><TMVAR2:19:01:00:000:000:Field3><REM2:Run macro><MACRUN2:{_Form3}><REM2:Display or retrieve 3 fields><REP3:01:000001:000001:00003:1:01:><REGRSTR:1:HKEY_CURRENT_USER\Software\Professional Grade Macros\PGM Functions\Swap\FieldName%N1%><TMVAR2:19:01:00:000:000:FieldName%N1%><TMVAR2:07:02:00:000:000:FieldName%N1% = ><TMVAR2:07:02:00:000:000:%T1%%CRLF%><ENDREP><TBOX4:T:1:CenterCenter000278000200:000:T2======================================
%T2%>
EDIT; "{_Form3} corrected, replaced
-
Hi,
Here's an idea (example too to run to check if you want?...)
1. Sort the file.
2. AScii process the file to check first and last entry for each ID
// Sort file first// Initialise Dos Sort
// Set Filename (and here, make example)
// Shut DOS in background if still running
// Set SORT switches
// Sort to Answertxt file
// Change spaces to commas, to use Ascii file process of csv file later
// process FIRST file lines
// Write FIRST line of ID file
// process file lines till second field (T2) not the same
// if it's a new ID
// Write LAST line of previous ("Current") ID file for that ID, and FIRST of next ID
// THEN; Re-assign the latest TIME for that Current ID
// Write LAST line of previous ("Current") ID file for that ID; at END
Best, Randall
-
Hi,
I don't know C++ or low-level programming; is the registry just too slow to use for parameters?
Best, Randall
-
HI,
iN wORD, sEND "f8" to "ExtendSelection", then find; text will be selected; then "copy", then "ESC to un-extend" [b4 Edit, said "Shift-F8 - wrong]
Best, Randall
EDIT -Correction; "Off afterwards is "ESC"
-
[EDIT]Hi again;
Perhaps I have mis-understood, or messed up the script?
Do you want the whole file on 1 line with commas instead of "CRLF", or do you want commas in the "csv" file to replace the "space"s?
Here with the spaces;
<REM2:text fileread; initialise><ASCIIC:2:1:10><ASCIIC:3:1:13><TMVAR2:08:03:02:000:000:><TMVAR2:19:03:00:000:000:CRLF><ASCIIC:3:1:9><TMVAR2:19:03:00:000:000:TAB><VSETMISC:T1:Installation Path><TMVAR2:19:01:00:000:000:InstallPath><REM2:Set File Name to Parameter1><TVAR2:01:01:%InstallPath%\File.txt><TMVAR2:19:01:00:000:000:Parameter1><REM2:Set from prompt if needed><IFOTH:01:2:%Parameter1%><TVAR2:01:01:%Parameter1%><ELSE><TVAR2:01:01:%InstallPath%\File.txt><TVAR2:01:02:FFile name?FFCenter:Center><TMVAR2:19:01:00:000:000:Parameter1><DOFILE:05:NN:%T1%>%InstallPath%\temp.txt><ENDIF><TMVAR2:19:01:00:000:000:FileName><REM2:Retrieve first line, count commas; add one for number fields answer><TVAR2:01:04:%InstallPath%\File.txt><TMVAR2:21:01:01:000:000: ,><TMVAR2:17:01:00:000:000:%InstallPath%\File.csvT><LAUNCHDEL2:0:01%InstallPath%\File.csv>Best, Randall
-
Hi,
I presume you want all the text file appended as 1 csv line?; [if you have lots of txt files to process, set "T1" through "repeat with folders", set full file path of files to "T1"]
<REM2:text fileread; initialise><ASCIIC:2:1:10><ASCIIC:3:1:13><TMVAR2:08:03:02:000:000:><TMVAR2:19:03:00:000:000:CRLF><ASCIIC:3:1:9><TMVAR2:19:03:00:000:000:TAB><VSETMISC:T1:Installation Path><TMVAR2:19:01:00:000:000:InstallPath><REM2:Set File Name to Parameter1><TVAR2:01:01:%InstallPath%\File.txt><TMVAR2:19:01:00:000:000:Parameter1><REM2:Set from prompt if needed><IFOTH:01:2:%Parameter1%><TVAR2:01:01:%Parameter1%><ELSE><TVAR2:01:01:%InstallPath%\File.txt><TVAR2:01:02:FFile name?FFCenter:Center><TMVAR2:19:01:00:000:000:Parameter1><DOFILE:05:NN:%T1%>%InstallPath%\temp.txt><ENDIF><TMVAR2:19:01:00:000:000:FileName><REM2:Retrieve first line, count commas; add one for number fields answer><TVAR2:01:04:%InstallPath%\File.txt><TMVAR2:21:01:01:000:000:%CRLF%,><TMVAR2:20:01:00:000:000:%InstallPath%\File.csvT><LAUNCHDEL2:0:01%InstallPath%\File.csv>// text fileread; initialiseVariable Set %T2% to ASCII Char of 10
Variable Set %T3% to ASCII Char of 13
Variable Modify String: Append %T2% to %T3%
Variable Modify String: Save %T3% to Environment Variable
Variable Set %T3% to ASCII Char of 9
Variable Modify String: Save %T3% to Environment Variable
Set Variable %T1% to "Installation Path"
Variable Modify String: Save %T1% to Environment Variable
// Set File Name to Parameter1
Variable Set String %T1% "%InstallPath%\File.txt"
Variable Modify String: Save %T1% to Environment Variable
// Set from prompt if needed
If File Exists "%Parameter1%"
Variable Set String %T1% "%Parameter1%"
Else
Variable Set String %T1% "%InstallPath%\File.txt"
Variable Set String %T1% from Prompt
Variable Modify String: Save %T1% to Environment Variable
Copy File or Files: "%T1%"
End If
Variable Modify String: Save %T1% to Environment Variable
// Retrieve first line, count commas; add one for number fields answer
Variable Set String %T1% from File: "File.txt"
Replace "%CRLF%" with "," in %T1%
Variable Modify String: Append %T1% to Text File
Program Launch: "File.csv"
Best, Randall
EDIT' [if you have lots of txt files to process, set "T1" through "repeat with folders", set full file path of files to "T1"]
-
Hi,
I think it is possible if you write to "controls" - check help file?
I could maybe help convert if you post the macro.
Best, Randall
-
Hi,
I'd probably need to know more about what you are doing and in what context. You may need to automate things a little more... try the previous thread?...
Best, randall
-
Hi,
Your file looks simple enough to use "Ini read/ ini write" if yoy change it to an ini file?
Best, randall
Examples;
-
Hi,
I'm not sure how reliable (won't work properly and will shutdown if both Web Pages in links in same explorer have same window title, as it relies on a change....), but seems to work?...
<TVAR2:01:06:><TEXTTYPE:<ALT><ARROW LEFT>><WAITWEB2:000010:000000:><TVAR2:02:06:><IFVAR2:4:02:1:T1><WCLS:"CURRENT"><ENDIF>Variable Set String %T1% from Window TitleText Type: <ALT><ARROW LEFT>
Wait for Web Page: ""
Variable Set String %T2% from Window Title
If Variable %T2% = variable %T1%
Window Close: Current Window
End If
I doubt the registry issue, cause it's a java thing from the Website, probably....
Best, Randall
-
Hey,
That was my line "post some code" means "give examples".
I'll try, but complex without using your original Windows and Code!
Best, Randall
-
Hi, Paul,
Isn't a WinHandle functionally equivalent to a control obtained for the outside Window anyway?
Is there a functional difference in this situation?
intersted.....
Best, Randall
-
Hi,
1. You may be able to speed it up ; there is a command; paste some code to sort out the problem?
Macro Control, macro playback speed/ mouse playback speed etc on that command.
2. That might be possible to calculate once you have (1) sorted, or it may be better to speed it up, then wait till a preset time - schedule it to run every 150 secs? (or timer macro on ME3 examples on Web site? - or in this forum)
3. If the 2 programs have different "control" index, you might be able to use "get Control" on each one, and "set focus to control" for C1 or C2, say, for using each one.
4. As you start the macro, "Set String variable" to name of current window title; then at the end, "window activate" T1, or whatever string you used.
Let me know; post some code.
best, Randall
-
Hi,
Probably the main thing is to check the clipboard has time ; you could just set a 1/2 sec delay, or add these others;
<REM2:Make sure your window has focus (or even the control if still problems with timing)><ACTIVATE2:notepad><WAITWIN2:000010:000000:notepad><TEXTTYPE:<HOME><SHIFT><END>><CLIPE><CLIPC><REM2:Make sure it has copied before proceeding (won't work idf the field could be empty, unless you accept only a certain number of checks)><TVAR2:01:01:><REP3:01:000001:000001:00020:0:01:><NMVAR:08:01:0:0000001:0:0000000><IMSD:25><TVAR2:01:03:><IFVAR2:1:01:2:><EXITREP><ENDIF><ENDREP><REM2:End of copy check><DVAR2:01:03:><REM2:Add a little leeway><IMSD:100><DMVAR:01:01:1:000000000000001.0000:2:.05><REM2:Make sure your window has focus (or even the control if still problems with timing)><ACTIVATE2:notepad><WAITWIN2:000010:000000:notepad><TEXTTYPE:%D1%>// Make sure your window has focus (or even the control if still problems with timing)Activate Window: "notepad"
Wait For Window Title: "notepad"
Text Type: <HOME><SHIFT><END>
Clipboard Empty
Clipboard Copy
// Make sure it has copied before proceeding (won't work idf the field could be empty, unless you accept only a certain number of checks)
Variable Set String %T1% ""
Repeat Start (Repeat 20 times)
Variable Modify Integer: Inc (%N1%)
Delay 25 Milliseconds
Variable Set String %T1% from Clipboard
If Variable %T1% <> ""
Repeat Exit
End If
Repeat End
// End of copy check
Variable Set Decimal %D1% from Clipboard
// Add a little leeway
Delay 100 Milliseconds
Variable Modify Decimal: %D1% = %D1% + .05
// Make sure your window has focus (or even the control if still problems with timing)
Activate Window: "notepad"
Wait For Window Title: "notepad"
Text Type: %D1%
Best, Randall
Word 2003 & Macro Express
in Macro Express 3.x
Posted
Hi,
more simply, try;
Write in macro express;
1. activate word window, appropriate document (form)
2. CRL-G -"goto" -wait
etc;
All this macro would do would be to copy the content; but you could get the properties too to strings by opening that box in your picture once you are there;
etcBest, Randall