Jump to content
Macro Express Forums

bobaol

Members
  • Posts

    9
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by bobaol

  1. Hi acantor, thank you for your response. i want to close the loop here and say that this post was created in error. i apologize for my mistake. i asked the same question here already.
  2. Hi Frank, For something like you're describing, I prefer to work with Excel (or any spreadsheet) and then copy and paste the data to the form. I would set up the data in Excel in a grid, then set the MacroExpress macro to copy and paste each piece of data into the respective field in the form. Then save the form. Of course, using key strokes like Tab is much more precise than using a mouse. Then use the MacroExpress macro to go to the next record and the next form, and loop it again. I usually use multiple applications (like Excel, NotePad, Paint, etc...) in conjunction with MacroExpress. Hope this helps.
  3. thanks to both of you! the F2 method worked (all my stuff are all values, not formulas). It looks like when it is copied from a cell, it does not work maybe because it has a carriage return, and the file name does not like carriage returns. When using the F2 method described above, it worked. setting it to 100miliseconds is too fast and does not copy. keeping it slower and adding the Text Box Display shows that the cell from Excel is copied (this is a very good idea). Here is the code that works. <COMMENT Value="/////"/> <COMMENT Value="/////"/> <COMMENT Value="///// Save__Clipboard_Save_Graphic_ using Date Time, and the cell in Excel as the file name"/> <COMMENT Value="/////"/> <MACRO PLAYBACK SPEED Speed="1"/> <COMMENT Value="///// Activate Excel, so you can copy the cell"/> <DELAY Flags="\x01" Time="1"/> <WINDOW ACTIVATE Title="xlsm save this as a template for use with Macro Express" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// copy the cell in Excel"/> <COMMENT Value="///// <CTRLD> is Control Down, C is Copy, <CTRLU> is Control up"/> <COMMENT Value="///// used <CONTROL>c to copy"/> <TEXT TYPE Action="0" Text="<F2>"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<CONTROL>a"/> <DELAY Flags="\x01" Time=".3"/> <TEXT TYPE Action="0" Text="<CONTROL>c"/> <DELAY Flags="\x01" Time=".3"/> <TEXT TYPE Action="0" Text="<ESC>"/> <DELAY Flags="\x01" Time=".3"/> <COMMENT Value="///// Set the copied cell from Excel as a variable"/> <COMMENT Value="///// To set variable, do this: 1. Click Variable Set String"/> <COMMENT Value="///// 2. In Options, What method would you like to use? Choose Set value from clipboard"/> <COMMENT Value="///// 3. in the Destination variable: box, type in %cell%"/> <VARIABLE SET STRING Option="\x02" Destination="%cell%" NoEmbeddedVars="FALSE"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// use Text Box Display to test whether the %cell% is copied from the clipboard"/> <TEXT BOX DISPLAY Title="Test_to_make_sure_it_caputred_the_Copy_Cell_from_Excel" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 %cell%\r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <DELAY Flags="\x01" Time="3"/> <COMMENT Value="///// set Date Time variable"/> <DATE/TIME Format="yyyy'-'mm'-'dd'--'hh'.'nn'.'ss ampm" Flags="\xB0" Date="01/24/2018 11:37:02 AM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" Variable="%Date_Time_as_text_Variable_%" IsDateVar="FALSE"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// screen-shot"/> <TEXT TYPE Action="0" Text="<PRTSCR>"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// save screen-shot as graphic png image, using Date Time varaible as file name"/> <COMMENT Value="///// notice the %cell% variable is now part of the Save Graphic File Name"/> <CLIPBOARD SAVE GRAPHIC Filename="c:\\temp2\\%cell%__________%Date_Time_as_text_Variable_%___.jpg" Prompt="FALSE" _IGNORE="0x001C" _IGNORE="0x0002" _IGNORE="0x001B" _IGNORE="0x0010" _IGNORE="0x0003"/> <DELAY Flags="\x01" Time="1"/>
  4. Hi rberq, your suggestion did not work. I think the problem is that setting the Copy Clipboard from Excel to %cell% does not work because when the screen-shot occurs later, the screen-shot uses the clipboard to store the image. So the screen-shot goes to the clipboard and overwrites the Excel %cell% clipboard. If there is another way to store the content of the Excel Cell, then that might work. That was why I was thinking of pasting the cell into NotePad then somehow use the value in NotePad to feed the file name. Here is the code I wrote based on your suggestion: <COMMENT Value="/////"/> <COMMENT Value="/////"/> <COMMENT Value="///// Save__Clipboard_Save_Graphic_ using Date Time, and the cell in Excel as the file name"/> <COMMENT Value="/////"/> <MACRO PLAYBACK SPEED Speed="1"/> <COMMENT Value="///// Activate Excel, so you can copy the cell"/> <DELAY Flags="\x01" Time="1"/> <WINDOW ACTIVATE Title="Excel" Exact_Match="FALSE" Wildcards="FALSE"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// copy the cell in Excel"/> <COMMENT Value="///// <CTRLD> is Control Down, C is Copy, <CTRLU> is Control up"/> <COMMENT Value="///// used <CONTROL>c to copy"/> <TEXT TYPE Action="0" Text="<CONTROL>c"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// Set the copied cell from Excel as a variable"/> <COMMENT Value="///// To set variable, do this: 1. Click Variable Set String"/> <COMMENT Value="///// 2. In Options, What method would you like to use? Choose Set value from clipboard"/> <COMMENT Value="///// 3. in the Destination variable: box, type in %cell%"/> <VARIABLE SET STRING Option="\x02" Destination="%cell%" NoEmbeddedVars="FALSE"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// set Date Time variable"/> <DATE/TIME Format="yyyy'-'mm'-'dd'--'hh'.'nn'.'ss ampm" Flags="\xB0" Date="01/24/2018 11:37:02 AM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" Variable="%Date_Time_as_text_Variable_%" IsDateVar="FALSE"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// screen-shot"/> <TEXT TYPE Action="0" Text="<PRTSCR>"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="///// save screen-shot as graphic png image, using Date Time varaible as file name"/> <COMMENT Value="///// notice the %cell% variable is now part of the Save Graphic File Name"/> <CLIPBOARD SAVE GRAPHIC Filename="c:\\temp2\\%Date_Time_as_text_Variable_%%cell%.jpg" Prompt="FALSE" _IGNORE="0x001C" _IGNORE="0x0002" _IGNORE="0x001B" _IGNORE="0x0010" _IGNORE="0x0003"/> <DELAY Flags="\x01" Time="1"/>
  5. Hi, i'm wanting to copy a cell in Excel, then use that cell as part of my file name when I save a screen-shot. Below is my code for creating a time-stamp, screen-shot, then saving it with the time-stamp as part of the file name. My current repetitive motion is to copy a cell in Excel, paste it to a certain web-site, then wait for the results. After the results are shown, screen-shot it and save the screen-shot (with the code below). But the problem is that I am not saving the file with a name that allows me to easily identify the file. I would like to use the copied cell from Excel as part of the screen-shot file name. I tried setting it up as a variable using Excel and setting it as Copy Clipboard variable, but it not working. I thought of copying the cell in Excel, paste it to a new NotePad file, then use the data in that NotePad file as the variable to use in the file name. But I do not know how to do that, or even if it is possible. Any help is appreciated. Thank you in advance. <COMMENT Value="Save__Clipboard_Save_Graphic__NICE__"/> <MACRO PLAYBACK SPEED Speed="1"/> <DELAY Flags="\x01" Time="1"/> <DATE/TIME Format="yyyy'-'mm'-'dd'--'hh'.'nn'.'ss ampm" Flags="\xB0" Date="01/24/2018 11:37:02 AM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" Variable="%Date_Time_as_text_Variable_%" IsDateVar="FALSE"/> <DELAY Flags="\x01" Time="1"/> <TEXT TYPE Action="0" Text="<PRTSCR>"/> <DELAY Flags="\x01" Time="1"/> <CLIPBOARD SAVE GRAPHIC Filename="c:\\temp2\\%Date_Time_as_text_Variable_%.jpg" Prompt="FALSE" _IGNORE="0x001C" _IGNORE="0x0002" _IGNORE="0x001B" _IGNORE="0x0010" _IGNORE="0x0003"/> <DELAY Flags="\x01" Time="1"/> <DATE/TIME Format="h:mm:ss AMPM" Flags="\xB0" Date="01/24/2018 11:37:02 AM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" Variable="%Date_Time_as_text_Variable_%" IsDateVar="FALSE"/> <DELAY Flags="\x01" Time="1"/> MacroExpress Pro 4.9.1.1
  6. Hi Terry, You make a good point, as I usually never provide additional feedback after the issue is resolved. Thanks for bringing this to my attention. I will be more diligent on this matter in the future. As for feedback regarding this particular issue, the issue is resolved. The method I ended up using is looking for the words inside the Clipboard. I will post the code below. As for your solution in itself, yes, it worked. And I really appreciate the code, and I understand the code. However, it is not exactly what it was I was asking for. I guess what I was really looking for is a way to evaluate the data inside Notepad. That is, today I am looking for the number 15 inside Notepad, but tomorrow, I want to use the same method to look for the letters Hello_World, and so on... In my code below, it asks if Clipboard contains 15, then stop. I want it to say is if Notepad contains 15, then stop. <DELAY Flags="\x01" Time="1"/> <REPEAT START Start="1" Step="1" Count="10000" Save="FALSE"/> <DELAY Flags="\x01" Time="1"/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\WINNT\\NOTEPAD.EXE" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12"/> <DELAY Flags="\x01" Time="1"/> <VARIABLE SET INTEGER Option="\x13" Destination="%N[5]%"/> <DELAY Flags="\x01" Time="1"/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\WINNT\\NOTEPAD.EXE" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12"/> <COMMENT Value="// select all and clear all of it, in case there is anything in the NotePad"/> <TEXT TYPE Action="0" Text="<ALT>"/> <TEXT TYPE Action="0" Text="e"/> <TEXT TYPE Action="0" Text="a"/> <TEXT TYPE Action="0" Text="<DELETE>"/> <TEXT TYPE Action="0" Text="%N[5]%"/> <DELAY Flags="\x01" Time="1"/> <ACTIVATE OR LAUNCH Title="Notepad" Exact_Match="FALSE" Wildcards="FALSE" Path="C:\\WINNT\\NOTEPAD.EXE" Mode="\x00" Default_Path="TRUE" Wait="1" Wait_For_Program="12"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="// select all"/> <TEXT TYPE Action="0" Text="<ALT>"/> <TEXT TYPE Action="0" Text="e"/> <TEXT TYPE Action="0" Text="a"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="// copy"/> <TEXT TYPE Action="0" Text="<ALT>"/> <TEXT TYPE Action="0" Text="e"/> <TEXT TYPE Action="0" Text="c"/> <COMMENT Value="// select all"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="// http://pgmacros.invisionzone.com/index.php?showtopic=5081"/> <COMMENT Value="says, if the clipboard contain the value 15 then stop the macro. 15 is for 3pm."/> <IF CLIPBOARD Option="\x01" Text="15" CaseSensitive="FALSE"/> <MACRO STOP/> <END IF/> thanks.
  7. I am running a scrape of web pages beginning at 5am. The macro scrapes thousands of pages, takes the text, and dumps the text into an Access database for further modification and analysis. I really do not want to define how many pages the macro actually scrapes. I use the Repeat 100000 times counter. All the different pages are in a excel spreadsheet. so, i go to excel, copy and paste the address, then do the copy of the entire web page. I just want it to continue running the macro forever, until it hits 3pm. At 3pm, i want this macro to stop, and have another macro begin, so that the data can be processed in the database. thanks.
  8. Hello, i am using ME Pro 4.2.2.1. I have a macro that runs and runs and runs. I want that macro to stop at 3pm. It can be 3:10pm or 3:35pm. really does not matter. I read the post http://pgmacros.invisionzone.com/index.php?showtopic=4277 But I am stuck. Here is how I am approaching it. Forgive me, as I am not good with taking a "how it works" and translating it into the actual code. So, I am posting my code here. And if you are replying, please please post code. ok... so using the Note Pad method that I read from the post.... This is what I created. The name of my macro is P4612 Line 01. Activate or Launch: Window "Notepad", Program "NOTEPAD.EXE", Parameters "" Line 02. Delay: 1 seconds Line 03. Variable Set Integer %N[5]%: Set to the Current Hour Line 04. Delay: 1 seconds Line 05. Activate or Launch: Window "Notepad", Program "NOTEPAD.EXE", Parameters "" Line 06. Text Type (Simulate Keystrokes): <ALT> Line 07. Text Type (Simulate Keystrokes): e Line 08. Text Type (Simulate Keystrokes): a Line 09. Text Type (Simulate Keystrokes): <DELETE> Line 10. Text Type (Simulate Keystrokes): %N[5]% ok....those ten lines gave me the Hour in NotePad. When the value in NotePad says 15 (15 is 3pm), I want macro P4612 to stop running. So I created a macro named P4613. However, I have no idea as to how to write the code that says: check the value in NotePad. If the value in NotePad is 15, then Macro Stop. Any help is appreciated.
×
×
  • Create New...