Jump to content
Macro Express Forums

Yehnfikm8Gq

Members
  • Posts

    397
  • Joined

  • Last visited

Everything posted by Yehnfikm8Gq

  1. The outline I gave was for some minor manual input (selecting the folder with the pdf). If you already know the folder you can skip that step and put the foldername directly in the Repeat with Folder command. I mostly help outlines and code snippets. If you don't do most of it yourself you don't learn for next time. If IFs are your problem here's a more detailed outline of that part. To speed things up it would be best to monitor the progress bar bottom right. It does not seem to be a window so you can only monitor the colour. The bar is shaded blue (on my pc) and background black. The close icon is part-red. The black is a better target but text behind it may also be black. Should that be the case for a particular pdf it will simply waste some time. You will have to be quick getting the position coordinates. A large pdf would help. What is in the macro below suits my 1024x768 monitor setup. I always run my apps maximized when using coordinates for consistency. It may be possible to monitor the progress bar with Controls but it is so fleeting I could not spend the time investigating. Load a pdf, enter some search text then run this. It presses Enter and displays text boxes with action to be taken depending whether a string is found. Try with garbage strings and strings you know it will find. In your macro you would remove the text boxes and put in the necessary logic. Text Box Display: Before Starting Activate Window: "pdf" Text Type: <ENTER> Repeat Start (Repeat 40 times) Delay 0.5 Seconds Get Pixel: Screen Coords: 900,710 into %N10% If Variable %N10% <> 0 Repeat Exit End If Repeat End Delay 0.5 Seconds If Window Title "Adobe Reader" is on top Text Type: <ENTER> Text Box Display: String not found, close pdf, open next one Else Text Box Display: String found, close pdf, enter Excel data, open next pdf End If <TBOX4:T:1:CenterCenter000278000200:000:Before StartingOpen PDF, put in search string, close this box><ACTIVATE2:pdf><TEXTTYPE:<ENTER>><REP3:01:000001:000001:00040:0:01:><DELAY:0.5><GETPX:10:S:000900:000710><IFVAR2:2:10:2:0><EXITREP><ENDIF><ENDREP><DELAY:0.5><IFOTH:03:1:Adobe Reader><TEXTTYPE:<ENTER>><TBOX4:T:1:CenterCenter000278000200:000:String not found, close pdf, open next oneString not found, close pdf, open next one><ELSE><TBOX4:T:1:CenterCenter000278000200:000:String found, close pdf, enter Excel data, open next pdfString found, close pdf, enter Excel data, open next pdf><ENDIF> (Edit) I forgot the IF logic if you are processing a folder with non-pdfs. When the Repeat with Folder returns the full filename, say into T1, if T1 does not contain pdf then skip the file processing.
  2. I was exploring along similar lines with decimals (hence my post about how annoying it was entering %Sales[%N[1]%]%). The If statements seemed to work OK for those. I was trying to see how many members of an array were populated. My problem was with the empty members having 0.0 put in them by default - which could also be a genuine value. The only method I found that worked was to fill the array members at the start, each with the same ridiculous number such as 1E12. That could then be used to tell which members had been populated otherwise. It was a somewhat academic exercise because instead of doing that you could just keep track of members as you assigned values.
  3. I'm still not sure how the information is being added to the clipboard but anyway I wrote a quickie macro with AutoIt that may help. If a filename is copied in Explorer by right-click copy or select-copy this short macro will put the full filepath in T77 and display in a text box. If this is of any use, edit as needed. I also tried this in several non-Explorer file listings and it also works if plain text has been copied. Only tested in XP. External Script: AutoIt Text Box Display: Results <EXTERNAL SCRIPT Language="AutoIt" Dest="%T[77]%" Script="$contents = ClipGet()\r\nConsoleWrite($contents)\r\n"/> <TEXT BOX DISPLAY Title="Results" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\lang4105\\f0\\fs16 The filepath is %T[77]%\\lang1033\\f1 \r\n\\par }\r\n" Left="276" Top="275" Width="546" Height="93" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> Let me know if this works on other PCs regardless of whether it solves this thread as I'm a beginner with AutoIt! I also made a standalone compiled exe which puts the results back on the clipboard (presumably deleting what was there).
  4. I don't know if this is of any help. It seemed to me that what you think you see on the clipboard may not be what is actually there. If you copied a file off Explorer, why would the filepath be there? An exe for example does not contain the filepath neither does a text file. Perhaps what you are seeing as a filepath is Clipboard internal stuff. I looked at clipboard content using a hex viewer. Pasting the clipboard asked for the clipboard format. They don't mean much to me. From Explorer there were 7 format options (from Data Object through OLE Private Data); from Directory Opus 17 options. Filename or filenamew options produced the full text path which could be copied. Filename from Explorer sometimes produced 8.3 filenames so you had to go to filenamew. If you copied an exe file for example, it does not matter what any viewer says, when you paste the file, all that is pasted is the content of the exe file. There is no path information.
  5. Are you asking for someone to do it for you or are you asking for advice? It's not very likely that someone has the exact macro. Here's a rough outline of what is required: Put all pdf files in one folder Macro: Prompt for user to enter search text string (text variable) Open Excel spreadsheet (or create new) Repeat with Folder (per above) Open pdf file Fill in Search box (type Ctrl+F then search string, then Enter) Determine if string is not found (not found dialog appears and has to be cleared) If found (no dialog appears) close pdf and bring Excel to the top Use Excel's Go To command to select cells for pdf filename/search string and enter data Increment cell position for next set of data (eg start of next row) Repeat End Save Excel spreadsheet The only iffy part is the not found dialog which has the same partial title as the pdf (Adobe Reader). That would be best done using Controls which is more advanced. (Edit) It can also be done by checking the exact window title "Adobe Reader" has appeared. It was not clear whether you have one search string for all the pdfs or whether it will be a different one per pdf. If it is the same search string you don't need to continually add to the spreadsheet with each filename. Once should suffice (say at the start of the file list). You can have other files in the same folder as the pdfs but you will have to add some logic in the Repeat Folder loop to only process pdfs. If the pdfs are not in one folder it will be more complicated. Processing many pdfs will take time, the bulk of that will be opening the pdfs.
  6. It's quite easy to do in the pro version! Personally I would use a hotkey macro to close the window and application. I'm not thrilled about mouse activations since they are always active. We get used to clicking the mouse freely so you need careful thought to avoid unexpected actions. Using a mouse, there are more options than you mentioned: When activating with (say) a left mouse click, it does not have to be the whole screen. You can specify the active pixel region of the screen with the dialog. You could for example specify a pixel area 20 pixels square in the bottom right corner of your screen. Click in that corner (where the clock usually is) and the macro will run. If you never move the application window, you could specify a relatively small active area around where the close button usually is. Ask if you cannot figure out how to do that, quoting your screen resolution or read my post in this thread mouse click. That does not help you with windows coordinates, which is a better way to go. You can also click on a window part (2nd radio button in dialog) such as the title bar. Those window part options may be inconvenient.
  7. I also type in a dummy number. The extra [] in MEPro makes the typing that more onerous. The %% are bad enough in both versions. I have a hotkey macro that types in the basic variable string depending on dialog title with the [] content highlighted. So in a "Variable Set String" the macro would type in %T[0]% with 0 highlighted (for over-typing). That only works for the basic variable formats T, N, D, C which are already defined. I prefer to stick with the mouse wherever possible.
  8. If you have an array such as Sales[1]....Sales[10] and you want to process each one (to add 5% for example) the following seem to work OK when manipulating the array members, %Sales[%count%]% or %Sales[%N[1]%]% where count or N1=1-10 If you manually enter in the "Variable Modify Decimal" dialogs they work fine mathematically. However they seem impossible to enter in the second "Insert Variable" dialog due to the extra [] or %% which are seen as invalid. Is there a way of entering this style of variable in the "Insert Variable" dialog? It seems to me that Integer arrays should be listed in ALL the "Insert Variable" dialogs (text, decimal, control etc) so that arrays can be handled. In the above example clicking Sales array would bring up Sales[] with the cursor between []. Clicking on the N array would complete as Sales [%N[]%] with the cursor again between [] and you would type in 1 hence Sales[%N[1]%]. The outer %% added per normal when you exit the dialog. Maybe I missed something somewhere.
  9. I've off for a few hours. Is this text file visible? Will the entries keep been added out of sight? What sort of text is being added? Do you have to save each line as it appears or can you do it at the end? To tell if there is a new entry with a visible file you could activate the file every so often, Ctrl+End (end of text), get the cursor coordinates and see if it has changed from last time. It's very dependent on the writing mechanism. It sounds as though there are blank lines between entries (from your use of <Enter>). I tested a clumsy macro that would separate by CR/LF when done, using the ASCII values but I'm sure someone else will have something that will work.
  10. I don't think Enter is a valid character to split on. You got multiple values with spaces because they are valid. I don't know how to split on a new line, if it's even possible with this command and plain text. I ran your macro which worked fine (my split variable was %log% with an array size of 25). I chose "the" to split my file with. I used large text boxes to look at the values of %Test2% and %log[1]%, %log[2]% etc after the Control Text and the Split String lines. The debug window only shows a small amount of text. You want to monitor the file for changes but if it is not being saved, how is the text being changed? Any actions by ME directly will be known to you or by the application that's doing it.
  11. I was right, I'm the wrong guy. I thought your last post might be the alternative scenario. One of the experts will have to comment on what characters can be pasted from the Clipboard. If it's a large file it would take some time to Paste into ME but I'm sure you must have waited long enough.
  12. I'm not sure I'm the best person to answer this but how are you copying the filenames? Just selecting in Explorer won't work as far as I know. If you click the name, short delay, click again, (+ Shift+End in Opus), Ctrl+C that will copy the text name. Other 3rd party XP shells (eg ExplorerXP or Directory Opus) will copy the file name or complete filepath to the clipboard with a few (macro?) key presses. I don't know how many times I've used the full filepath utility in DO while making macros! I don't have Vista or W7.
  13. Adirondacker - I have several text editors that show the number of lines however there was no way of extracting the information directly. If it's not a usable Control you are out of luck. I had to try a few new editors until I found one that worked. It was small, fast and required no installation. Paul - That's a neat solution. I'm sure I tried AutoIt years back but migrated to ME. With my method I tried a 9MB file with 226,000 lines. That took 7 seconds. Mine's almost as big as yours! Total including character count of 9703175 took a minute.
  14. Item 3: We all have wondered at some time or other if there's a better way to count lines. Realistically, it does not take very long to do small files. My old PC will count a 33,000 line file in 42secs, about 720 lines per sec. It would be nice if you could process a text file without copying each line into a variable. I would think that would speed things up no end. Request for a feature? Just for the hell of it I found a free text editor from which I could get the line count. I wrote a macro that opens the text file with the editor, activates the line count, copies it using a Control, closes the text editor and processes the Control into a Text or Integer variable, all in less than 3 seconds for the above file. So I guess there are alternatives, fast but clumsy.
  15. You seem to have it figured out! Here's an outline: (Optional 1: Text Box Display "Position Mouse in Desired Location then hit keyboard Enter to proceed" ...when you hit Enter the Text Box Display disappears and the macro continues) Get Mouse Position into variables N5, N6 (to screen or window your choice) Get Pixel Color at N5, N6 into variable N1 (Optional 2: Put current partial window title into variable T1) Repeat Until ..... (your choice) (Optional 2: Activate partial window title T1 + short time delay) Get Pixel Color at N5, N6 into variable N2 If Variable N2 <> N1 Mouse Move N10,N11 (x,y to screen or window as above) Mouse Left Click Mouse Move N5, N6 (to screen or window as above) Mouse Left Click End If Time Delay (how often the pixel color is checked) Repeat End I'm sure a number of small time delays will be required depending on how quickly the page changes after the mouse is clicked. If the Time Delay is long, you could also put it at the start of the repeat loop so that there is not a long delay after the final Mouse Click. If you are monitoring a single pixel you cannot rely on the mouse staying exactly in place. That is why you save the mouse position as the first step and use the coordinates after that. I didn't debug the above. When to stop the repeat is too dependent on your application. You can stop the macro manually or add some logic to do it. Options: If you don't want to bother with the Text Box Display you will have to position the mouse before running the macro. If this is working unattended and particularly over long periods of time, you may need to add interlocks to ensure no other window is on top. I added the option of getting the current partial page title and activating before checking pixel color etc. This may not be needed if attended or short-term operation, and would be undesirable in high-speed checking (very short time delay). It may not work if the page title changes after the mouse click. That is why you use a partial title. Let's say it's Firefox, "Mozilla Firefox" is nearly always in every page title so you can ensure the browser is on top even though the full page title has changed. Depending on application you may also be able to use change of page title rather than mouse color. You may want to consider using the keyboard (Text Type) to do the necessaries at x, y (if it's a button) and more advanced, use Controls.
  16. Thanks for the responses. I sent a bug report a few days ago. I re-sent today with a simple macro. Same issue. Considering the difference in variables format between the two versions, it may not like the square bracket in a text string.
  17. This is one of those conflicting situations answering questions on a macro that is going in the wrong direction. Activating the macro with a left mouse click is a bad idea but the question was asked (twice) about setting up the activation dialog. Rberg's solution seems fine to me. You would have to make the first mouse click manually as the first scheduled click will not occur for 4min 30secs after the macro is enabled. The only issue I see is with handling changes in window order (for example if some software auto update brings up a window). If you set the scope to a specific window being on top, that prevents other windows being inadvertently clicked. However, you will not be aware of it if you are away from the PC (elsewhere in house or office). There are several ways to handle that. One method would be to have global scope with macro as follows: If Window on Top (as specified) Mouse Left Click Else Sound Wav File (alarm) or any other notification (email to Blackberry?) End If Another method is to have an Activate Window command prior to the mouse click (which will handle window order issues). However, if the window is not there due to the program shutting down, all you will get is the system alarm wav and error message. Handling mouse jogs and drifts is a more difficult issue which only needs addressing if it's a problem.
  18. The Help that I have is for an older version of ME3, showing a different dialog for the activation. The text however is correct. You want Left Mouse click, Area on Screen. The four corner x,y coordinates for a monitor that is 1024x768 are as follows: Top left 0,0 Top right 1023,0 Bottom left 0,767 Bottom right 1023,767 So the data entry is Left 0, Top 0, Right 1023, Bottom 767 That is the ENTIRE screen on a 1024x768 monitor. For a full HD setup (1920x1080) the data entry would be 0 0 1919 1079 As a different example if you want to restrict the active mouse click to the top left quarter, the data entry would be 0 0 511 393 If you have problems with the maths, use the mouse locator on the dialog. Stick the mouse top left and bottom right of the screen, using the hotkeys as noted next to the locator button to save the figures (just like you do for the Mouse Move command).
  19. I had problems with a converted macro which turned out to be due to an incorrect conversion: Original ME3.........If Variable %T1% contains "[H:\" Converted to MEPro........If Variable %T[1]% Contains "[H:\\" Removing one of the backslashes cured the problem I'm sure I saw something somewhere about this but I can't find it and Help search doesn't allow the \\ search string. Is it a bug or is it in a dire warning list somewhere?
  20. To resolve your question about Area on Screen (which is what you indicate you want) see the Help (F1 when you are in the mouse activation dialog gives you the page directly). ME's Help is excellent and there is no point pasting it here. Note that pixel position is measured from top left, 0, 0 so the limits for a 1024x768 monitor would be right 1023 and bottom767. The only thing I would be concerned with is if the mouse drifts, gets nudged or some other window comes to the top. Whether those are issue depends on your circumstances (got a cat?) and scope settings.
  21. Not something I would do as I'm not musically (or generally) appreciative first thing. I would go a different route using an mp3 player. I'm sure you can do this with most players - I tried it out with WinAmp: Create a playlist (eg .m3u) of your faves in the player (add files to a New List and Save the list) Schedule ME to run the specific playlist (m3u) file at the time (you will have to select All Files in Program Launch to see the .m3u files*) Windows will run the playlist (m3u) file in your default player (WinAmp happens to be that for m3u files on my Pc) This had the advantages: ME runs the macro for a fraction of a second You can make several playlists and get ME to choose one at random You can take advantage of the player's customization such as Shuffle, Loop (or not) * to open any non-exe file in Windows that has a default application, Program Launch the actual file whether jpg, txt or mp3 etc. It will open in the default application.
  22. Thanks Kevin. Unfortunately I already uninstalled MEPro which was unusable and reinstalled 4.1.1.1. I had tried a reinstall and a repair install. Your advice noted for next time (hopefully not). Was 4.1.2.1 the first rev that needed a reboot? I don't remember doing that before. I could not do so right away and the PC froze before I rebooted. At the time I thought it was due to other issues but I now suspect 4.1.2.1 install. The menu bar seemed to be there (although there were 4 dots compared to 3 in 4.1.1.1). BTW after dissing Controls in other posts I resolved a few Firefox issues using them!
  23. The answer is yes. ....but you probably want to know how! I've done this a few ways but some manual or timed intervention may be needed. Basically you are trying to tell if a window of any potential name disappears. Get the window name at some point in time and have a repeat loop to tell if it does not exist Get the pixel colour at a "good" point on the window and have a repeat loop to tell if it changes Not having the browser I can only guess. Let's say you start the downloader during the night using the macro. After X secs when you are sure the window will exist and is stable, get the topmost window name into a variable. Use that variable in an "If window does not exist" loop. Probably the only bet if you are still working on the pc and changing windows. If you are around when the download window opens you could manually start the macro with no timer. Does the download window have any unique but repeating part to the name? eg Thefilethatisdownloading - Maxthon In this case "If window does not exist" loop can be based on partial window title, Maxthon. Even jpg or avi in the window title may do (use multiple Ifs of all your standard file download extensions). Firefox would be easy because the window is "Downloads". Although I avoid mouse moves and XY coordinates, the download window will usually be in the same place and maybe the same size. Pick a point that is unique in colour (but the same every time). Get the pixel colour at those coordinates into a variable (relative to window if it's not fullscreen). Every so many secs check the pixel colour and if it has changed, the window no longer exists. This is more of a "loss of focus" rather than window has closed. You need to be aware of what may be behind the window. If you choose Windows grey and the Window behind is the same it will not work! If the download window is variable size, get the window height and width and calculate the pixel measurement point from there (eg from the bottom left corner). I have a manually initiated macro that I use to temporarily monitor ANY window or applet by this method. Slightly more flaky, use the Repeat with Windows command every so often and count up the number of visible windows with an integer variable that increments by one every time through the repeat. Save integer. When it diminishes by 1..... Edit: A variation of this one combined with method above (if window title contains the filename) is to put every visible window name into a text variable and if any contain .jpg, .avi, .doc etc then the download window is still open. Effectiveness depends on other open windows. You could investigate Controls. I've had very limited success with browsers (and most other things for that matter!) I used to give a preemptive audible when my email was finishing downloading (slow connection). I monitored the colour of the end of the progress bar box. Edit: When I have browser activity unattended, I open a fullscreen Notepad page called blank.txt before I open the browser. The idea is that if things go amiss I have an extra layer of protection against errant keystrokes re-formatting the drive etc! Using this method, you could have a repeat loop that says "If blank.txt is on top" once the download page has appeared, then the download window must have closed. The above are basic outlines. If you can't figure how to implement, ask. If anyone else has workable methods I'd be interested to know too. I use a Ding for minor events, Tada for medium events and Nero's Trumpet wav if I want the neighbourhood to know.
  24. No problems with MEPro 4.1.1.1 and FF 3.5.5, although you've seen my problem with 4.1.2.1! I had a crash today but I think it may be unrelated.
  25. The bar is there but no legend. Reinstalled but still legendless! I reported to ISS.
×
×
  • Create New...