Jump to content
Macro Express Forums

acantor

Members
  • Content Count

    766
  • Joined

  • Last visited

  • Days Won

    5

acantor last won the day on April 11

acantor had the most liked content!

Community Reputation

7 Neutral

About acantor

  • Rank
    Master

Contact Methods

  • Website URL
    www.cantoraccess.com
  • ICQ
    0

Profile Information

  • Location
    Toronto

Recent Profile Visitors

503 profile views
  1. Text File Begin Process: C:\Users\Me\Documents\tmp.csv Text Type (Simulate Keystrokes): %Value%<ENTER> Text File End Process <TEXT FILE BEGIN PROCESS Filename="C:\\Users\\Me\\Documents\\tmp.csv" Start_Record="1" Process_All="TRUE" Records="1" Variable="%Value%"/> <TEXT TYPE Action="0" Text="%Value%<ENTER>"/> <TEXT FILE END PROCESS/> I have the values stored in a column in the file tmp.csv: A AA AAA etc. The macro outputs each value followed by a new line.
  2. A simple way to repeat, if you know the number of repetitions, is this: Repeat Start (Repeat 10 times) // Do something End Repeat Test this code, which repeats the action ten times, by copying the text below and pasting it directly into the Macro Express Script Editor. Sandwich your own commands between the "Repeat Start" and "End Repeat" statements. You might find it helpful to insert a delay of, for example, 1 second inside the loop, to better see what is happening when you run the macro. <REPEAT START Start="1" Step="1" Count="10" Save="FALSE"/> <COMMENT Value="Do something"/> <END REPEAT/>
  3. Not sure I understand the issue, but the solution may be to output the first value, navigate to the next cell using this: Text Type (Simulate Keystrokes): <ARROW DOWN> ... and then output the next value.
  4. Macro Express executes repeat loops astonishingly quickly. On my computer, repeating nothing a million times takes Macro Express about 3.3 seconds. Repeat Start (Repeat 1000000 times) End Repeat
  5. 1. Do you have Dragon running on your system? Dragon appears to intercept the Insert key and use it for internal purposes. 2. Are you testing your script in Microsoft Word? Word can be set to map the Insert key to Paste, which causes all sorts of mischief. Whether these two conditions are true or not, try changing <SHIFT><INSERT> to <CONTROL>v, or substitute the Clipboard Paste command. I'm not clear why you need to use the clipboard. Couldn't you use the Text Type command to insert the "backquote" character or characters?
  6. I am one of those other people! The only times I have separated press down from press up is when I have developed in scripts that activate as soon as the keys are pressed, rather than as soon as the keys are pressed AND released.
  7. When I was 13 years old, I participated in a 32 mile charity walk. Friends and family members pledged a penny or two or three per mile, but my Dad pledged one cent for Mile 1, two cents for Mile 2, four cents the Mile 3, etc. After completing the walk, one of my friends (who was perhaps a bit more mathematically inclined than I was) realized something was amiss, and sat down at his desk in our Grade 7 class with pencil and paper. It took him about half and hour to work out that my Dad had committed to contributing $42,949,672.95 to charity! My Dad wrote a cheque for $25, which was a lot of money in those days. A friend from a well-off family had pledged 5 cents per mile, and gave me $1.60!
  8. Your approach gave me an idea of another way to handle the input data, but without using the clipboard. Create a plain text file that consists of one line. I used Notebook to create the file. I inserted a string of 600,000 characters on one line. (PS: I typed 10 characters, selected everything and copied, and pasted ten times. Then I repeated the process until there are 1000 characters, then 10,000, then 100,000. It takes but a minute to generate hundreds of thousands, or millions, of characters.) Then the script uses "Text File Begin Process." I specified the variable to receive the information, and chose "Process All Records" beginning on record 1. It takes time to save the file, but once it has been saved, the macro runs almost instantly (at least on my computer). Text File Begin Process: C:\Users\Me\Documents\tmptmp.txt Text File End Process Variable Set Integer %y% to the length of variable %x% Text Box Display: %y% Variable Set Integer %Digit% to 0 Repeat Until %Digit% Is Greater Than "9" If Variable %x% Contains "%Digit%" Text Box Display: YES, contains at least one digit Macro Stop Else Variable Modify Integer %Digit%: Increment End If End Repeat Text Box Display: NO, does not contain any digits
  9. Adobe Acrobat and Macro Express don't play together particularly well. But here is an idea. Open the "Print" dialog, navigate to the "Pages" field, and press Tab. If there is more than one page, this field will read "1 - 33" (or whatever). I don't think you can navigate to this field if there is only one page, but you'll need to check.
  10. My computer is about three years old, with a 4th Generation Intel Core i7 CPU. The latest CPUs are 9th Generation. When opening the "set string" line to edit text consisting of hundreds of thousands of characters, I wait minutes! In fact, Macro Express freezes and becomes unresponsive. After two or three minutes, Macro Express rights itself. I would be curious to know how long my code takes to run on your computer with, say, a string of 5000 characters.
  11. Oops, there was a logic flaw in my original script. It wasn't testing for the presence of 9! I just tried this revised script with a string consisting of 1,200,000 characters, and it instantly reports if the string contains a digit or not. Variable Set String %x% to "[insert your string here]" Variable Set Integer %y% to the length of variable %x% Text Box Display: The string contains %y% characters Variable Set Integer %Digit% to 0 Repeat Until %Digit% Is Greater Than "9" If Variable %x% Contains "%Digit%" Text Box Display: YES, the string contains at least one digit Macro Stop Else Variable Modify Integer %Digit%: Increment End If End Repeat Text Box Display: NO, the string does not contain any digits
  12. I wrote the good folks at Insight Software to ask about the upper limit of characters when assigning string variables. Variable Set String %x%: Prompt The upper limit is 6,832 characters (including spaces), at least when the characters are pasted into the field. Variable Set String %Test% to "[very long string]" I've tested this with strings of up to 1,000,000 characters long without problems.
  13. I just tested my script with lengthy strings. It fails when the string is too long. But 500 characters seems to be OK.
  14. Here is a way to check if a text string contains numbers. It tests whether the text string contains a zero, then a one, then a two... all the way to nine. Variable Set String %x%: Prompt Variable Set Integer %Digit% to 0 Repeat Until %Digit% Equals "9" If Variable %x% Contains "%Digit%" Text Box Display: "%x%" contains numbers Macro Stop End If Variable Modify Integer %Digit%: Increment End Repeat Text Box Display: "%x%" does NOT contains numbers
  15. I have stopped using Adobe Acrobat Reader because of my inability to get the programs to obey its own hotkeys. Some work, some don't. My experiences automating or simplifying tasks in Acrobat Reader using Macro Express have been discouraging. I've had better luck with Nitro Reader.
×
×
  • Create New...