Jump to content
Macro Express Forums

MakaPakaTobyHannah

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by MakaPakaTobyHannah

  1. I played with this a bit and came up with a slightly different approach. Kunkel321’s approach didn’t work because it stayed in an infinite loop. Also, I haven’t inspected this, but I think in theory it’s possible that prevLine = currLine, and this appears somewhere within the script (not just at the end). In that case, the process would abort. So I thought, let’s start by copying the entire script to the clipboard. Assign that to a variable. Then, count all carriage returns and line feeds. That will tell you how many lines there actually are in the script. Use that counter variable for set a repeat loop. When the repeat loop is done, you’re at the end of the script. I have tested this now, and it works just fine on my system. Definitely NOT sexy! I would think it would be better to modify the script code directly for the color coding, rather than navigating through menus. I didn’t attempt that (yet). I did notice that, because the script contained variable definitions (apparently), the "trim" command failed, as apparently the script attempt to locate those variables. So I opted for replacing all % signs with PLACEHOLDER to circumvent that problem. Perhaps someone here can enlighten me how to deal with that issue (it’s come up for me before). Anyway, here is my script now; would love to know if it works for you. This is just set up at the moment to highlight text boxes dark blue background, bright yellow text font. Here it is: <VARIABLE SET TO ASCII CHAR Value="13" Destination="%T13%" _COMMENT="assign carriage return to %T13%"/> <VARIABLE SET TO ASCII CHAR Value="10" Destination="%T10%" _COMMENT="assign line feed to %T10%"/> <VARIABLE SET STRING Option="\x00" Destination="%CRLF%" Value="%T13%%T10%" NoEmbeddedVars="FALSE"/> <KEYSTROKE SPEED Delay="16"/> <TEXT TYPE Action="0" Text="<CONTROL>a"/> <CLIPBOARD COPY/> <VARIABLE SET STRING Option="\x02" Destination="%scriptToClipboard%" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%scriptToClipboard%" ToReplace="%" ReplaceWith="PLACEHOLDER" All="TRUE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY STRING Option="\x00" Destination="%scriptToClipboard%"/> <REPEAT UNTIL Variable="%scriptToClipboard%" Condition="\x07" Value="%CRLF%"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%scriptToClipboard%" ToReplace="%CRLF%" ReplaceWith="BunnyRabbit" All="FALSE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <VARIABLE MODIFY INTEGER Option="\x07" Destination="%counter%"/> <END REPEAT/> <VARIABLE MODIFY INTEGER Option="\x01" Destination="%counter%" Value1="%counter%" Value2="2"/> <VARIABLE MODIFY STRING Option="\x0F" Destination="%scriptToClipboard%" ToReplace="BunnyRabbit" ReplaceWith="BunnyRabbit%CRLF%" All="TRUE" IgnoreCase="FALSE" NoEmbeddedVars="FALSE"/> <TEXT BOX DISPLAY Title="This is the complete script" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 There are %counter% lines\\f1 \r\n\\par %scriptToClipboard%\r\n\\par }\r\n" Left="Left" Top="Center" Width="1921" Height="592" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <TEXT TYPE Action="0" Text="<HOME>"/> <CLIPBOARD COPY/> <VARIABLE SET STRING Option="\x02" Destination="%x%" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<TEXT BOX DISPLAY" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a text box!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <TEXT TYPE Action="0" Text="<ALT>e"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<END>"/> <REPEAT START Start="1" Step="1" Count="6" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW UP>"/> <END REPEAT/> <TEXT TYPE Action="0" Text="<ENTER>"/> <WAIT FOR WINDOW TITLE Title="Color" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <TEXT TYPE Action="0" Text="<HOME><ARROW RIGHT><ARROW RIGHT><ARROW RIGHT><ARROW RIGHT><ARROW DOWN><ARROW DOWN><ARROW DOWN><SPACE><ENTER>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<ALT>e"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<END>"/> <REPEAT START Start="1" Step="1" Count="7" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW UP>"/> <END REPEAT/> <TEXT TYPE Action="0" Text="<ENTER>"/> <WAIT FOR WINDOW TITLE Title="Color" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <TEXT TYPE Action="0" Text="<HOME><ARROW RIGHT><ARROW DOWN><SPACE><ENTER>"/> <END IF/> <REPEAT START Start="1" Step="1" Count="%counter%" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>"/> <CLIPBOARD COPY/> <VARIABLE SET STRING Option="\x02" Destination="%x%" NoEmbeddedVars="FALSE"/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<TEXT BOX DISPLAY" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a text box!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0" _ENABLED="FALSE"/> <TEXT TYPE Action="0" Text="<ALT>e"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<END>"/> <REPEAT START Start="1" Step="1" Count="6" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW UP>"/> <END REPEAT/> <TEXT TYPE Action="0" Text="<ENTER>"/> <WAIT FOR WINDOW TITLE Title="Color" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <TEXT TYPE Action="0" Text="<HOME><ARROW RIGHT><ARROW RIGHT><ARROW RIGHT><ARROW RIGHT><ARROW DOWN><ARROW DOWN><ARROW DOWN><SPACE><ENTER>"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<ALT>e"/> <DELAY Flags="\x02" Time="100"/> <TEXT TYPE Action="0" Text="<END>"/> <REPEAT START Start="1" Step="1" Count="7" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW UP>"/> <END REPEAT/> <TEXT TYPE Action="0" Text="<ENTER>"/> <WAIT FOR WINDOW TITLE Title="Color" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <TEXT TYPE Action="0" Text="<HOME><ARROW RIGHT><ARROW DOWN><SPACE><ENTER>"/> <END IF/> <END REPEAT/> <TEXT BOX DISPLAY Title="Done" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\qc\\b\\f0\\fs20 Finished!\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="181" Height="112" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <MACRO STOP/> <COMMENT Value="Stuff below this kept here for reference."/> <CLIPBOARD COPY/> <DELAY Flags="\x02" Time="100"/> <VARIABLE SET STRING Option="\x02" Destination="%x%" NoEmbeddedVars="FALSE"/> <COMMENT/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<TEXT TYPE" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a Type Text!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END IF/> <COMMENT/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<IF VARIABLE" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is an If Variable!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END IF/> <COMMENT/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<MESSAGEBOX" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a Message Box!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END IF/> <COMMENT/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<COMMENT" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a Comment!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END IF/> <IF VARIABLE Variable="%x%" Condition="\x06" Value="<TEXT BOX DISPLAY" IgnoreCase="FALSE"/> <TEXT BOX DISPLAY Title="This line is a text box!" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs20 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="TRUE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/> <END IF/> <COMMENT Value="TEST LINES"/> <COMMENT Value="Check the ability to check the content of an MEP instruction by selecting one of these four lines, then running this macro."/>
  2. I have been away from the computer for several days, but now I really want to thank everybody for this most valuable feedback! Very cool, indeed. 😉
  3. I recently developed an insane script of about 4,000 lines (ca. 80 pages) converting abstruse musical input code into a completely different language. I will make a video of that at some point and post it on YouTube. Anyway: of course, I use text boxes as stops copiously to debug my scripts. I wish there were a preference setting with which to color code certain items; I color code all my text boxes dark blue background, bright yellow text font. Annoying to have to do that individually each time. In a script of 4,000 lines, it is often necessary to activate a bunch of text boxes to find out where the error occurs. When a text box finally displays a faulty message, I know that somewhere before that text box, the error occurs. In a script of thousands of lines, and multiple text boxes displaying, how to you know where that particular text box is located? I have come to put line numbers at the top of all my debugging text boxes. But when the code then changes (additions or deletions), those line numbers are then off. Can you all confirm that, in fact, there is no way to put some kind of integer variable into a text box that identifies the line number of the text box? I think that would be cool to have. Cheers.
  4. Thanks for all the feedback. Anybody written to MacroExpress about this? I will now; I have found them to be very responsive. I think this is a serious limitation, and really wastes a lot of time.
  5. Further to this... a brute force approach. It’s interesting that some "wait for window" calls in this script function 100% reliably; the one activating the main application, however, fails more often than not. I agree, it must be how this application manages window titles. Be that as it may, I removed all calls for activating the main application window. Instead, as the macro is first called from within that application, with a scope set to that application, I use a left mouse click to click on the main application window, where needed. Now, the macro runs flawlessly. Saves a lot of tedious hassle...
  6. Grmpf. Thanks for that response, terrypin. At least I can see that I’m not the only one with this problem. I have never experimented with slowing down the macro, I'll try that now first. Very doubtful.
  7. This particular issue has plagued me for a very long time, and I just cannot figure out what the issue is. I find that "Window Activate" is extremely unreliable. Whenever I develop scripts where, after one thing is done in one window another window must be activated before the macro proceeds, the macro simply hangs. Today’s example. I wish to batch print to PDF all *.musx files in a given directory. For this to work, each *.musx files must first be opened, in turn. I have to: 1) Issue the open command to the first file in the list 2) Wait for the file to open 3) Issue a "print" command within the application (this will call Adobe Acrobat) 4) Wait for the PDF to have been compiled and open within Acrobat 5) Close the newly opened PDF 6) Reactivate the window of the original application 7) Close the file that was opened within that application 8) Continue on to the next file by looping back to step (1) There are various dialog boxes that come up (Open, Print, Save PDF File As). In order for the "open" and "close" commands (sent as keystrokes) within the main application to function properly, the main application must be active. Hence my use of the Window Activate command. I have experimented with "Exact Match," "Partial Match," "Partial Match" with "The name contains wildcards" checked and the use of the asterisk character. I have inserted delays in front and after the Window Activate commands. Sometimes it works, sometimes the macro hangs. Is this a known problem? Again, I have had trouble with this for so long, it’s not even funny. But today, I just cannot get this process to work reliably. I have hundreds of PDFs to compile, and I don’t want to do this manually one file at a time. MORE INFO I just inserted an "If Window is Running" check. I placed the window title precisely; instead of typing it, I populated the field by selecting the window title via "Browse". The "If Window is Running" check is supposed to open a text box saying, the window is running. But that text box doesn’t even come up. In other words, the If function doesn’t see the window, even though it is visible.
  8. Answering my own post... I see that nobody posted a response, or suggestion - which clearly indicated that the issue was specific to my system, which I had suspected anyway. I thought that maybe upgrading to the most recent ME version might solve the problem. It didn’t. I wrote to tech support; they were unaware of an issue as well. For anyone who might encounter this type of thing, this was the culprit in my case. I run three three monitors, and to maximize their usefulness I also run a utility called "Actual Window Manager" (which I love). On reinstalling my operating system and applications, Actual Window Manager installed default settings. I restored my preferences from a settings file I had backed up. But apparently, one crucial setting was not part of that backup. It is a mouse option that activates or deactivates a window on "mouse hover". When the mouse hovers over a window, it is activated. Conversely, if a mouse is moved off a window, it automatically becomes deactivated. I find that feature useless and annoying. Anyway, it was checked, and this caused some ME menu to close instantly, as the mouse pointer was not on top of the menu. Feature turned off, problem solved.
  9. I have had to reinstall my operating system (Windows 10) due to some corruption. I am in the process of reinstalling all my bits and bobs. I have a huge amount of macros for an application I run within DOSBox. For this, I have created an extensive menu structure. I invoke a main menu with a hotkey; from there, I can then select macros directly, or select submenus. This has always worked flawlessly. Now, however, not so much. When I invoke the main menu with the hotkey, and then navigate around in the menu, for instance with arrow keys, or click on a submenu, some of them pop up for an instant, but then close immediately. The upshot is, I cannot select from those menus, because they don’t stay open. I’ve looked around in Macro Express options, but I see nothing there that seems to help. Anybody have any idea what’s happening here??? Adding to this: my preferred "Menu Style" is "Windows Default." I find that if I change the style to "Nickname and Scope" (for instance), then the submenu works just fine: opens up and stays open for me to select from, either by keyboard or by mouse. Is this a Windows issue I am not aware of?
  10. Well... the MIDI input macro at this point is 868 lines of code... that was one of the most fiendishly difficult problems I ever had to solve; lots of sequencing simultaneously different points of the same array and fun stuff like that... due to the conventions of musical notation, the explicit nature of the MIDI code just cannot be translated directly into music notation code. The "text item entry" routine at this point consists of seven different macros, several of which are triggered by certain events. Total lines of code, in the aggreate, is several hundred, but that also contains a whole catalog of text items defined and referenced internally. But I have been using this now for two days, and it works like a charm. I don’t know why they can’t give us Multiple Choice windows where the choices are "formattable". In essence, I am using a text box as a multiple choice window. This is kind of daft...
  11. By the way, if it is of any interest... this turned out to be a major pickle, but I finally worked out all the kinks. For users of a different forum, I created a short video that illustrates how these macros operate. I use Macro Express extensively for working with a 16-bit MS-DOS application, that I run within DosBOX. Believe it or not, there are many people who do this... This video also shows a Macro Express macro that creates alpha-numeric input data from a MIDI input text string. Enjoy... Here is the link: https://youtu.be/FKRO_7hwk6o
  12. That’s why I append "&&THIS IS MY DOG&&" to the clipboard... I feel relative certain that I will never place that text string to the clipboard from any other source.... Anyway... I am actually quite amused at the absurdities of this challenge... but I’m almost there now!
  13. Yes, but Macro Stop is effective only for the macro that it is placed in; it cannot terminate another named macro. A lot of this is motivated by the fact that you cannot create multiple choice text boxes where the items are formatted by font. I want to be able quickly to select different text items whose text might be identical, but whose formatting is different. For instance: Allegro Allegro cresc. cresc. If you put this items into a multiple choice window, they all look the same. So you have to add some flags, like: Allegro <b> Allegro <bi> cresc. <r> cresc. <i> For longer lists, this soon becomes less than obvious. So I decided to pop these text items, formatted, into a text box. This text box is the last item in macro 1. Ctrl-Right clicking then activates macro 2. This one begins by double clicking on the item I control-right clicked in macro 1, copying that text string, and then closing the open window from macro 1. But I want the option to select more text items. So I need an IF statement to give me that option, of restarting macro 1. That works. But because macro 2 can then not continue, and thus not terminate, until the macro 1, that it called, is then terminated, the "Ctrl-Right click" activation cannot activate macro 2, as it is still active. I have now solved this problem (this is like Monty Python) by creating a text string in macro 2 that modifies a text string by appending "&&THIS IS MY DOG&&" and copying that text string to the clipboard. macro 3 (!!! YES!!!) has as an activation that when the clipboard contains "&&THIS IS MY DOG&&", it executes. This allows macro 2 to terminate, and I can refer back to macro 1 from macro 3. And now, I can "Ctrl-right click" again in my text box of macro 1... I have had to resort to subsidiary macros like that a few times in the past, but have never had to resort to three macros to get the effect that I need. I wish that Macro Express would, at some point, include the possibility to create Multiple Choice windows that display formatted text strings, and that will allow mixing radio buttons and check boxes. I know you can run external scripts (like AutoIT) to effect this, but I am not sufficiently versed in that.
  14. Is there a way to terminate a macro from within another macro? I have a macro (macro 1) that, as its last item, displays a text box. Control-right clicking on an item in that text box triggers another macro (macro 2), the "Control-right click" being the trigger for that macro. Part of macro 2 includes closing the text box of macro 1, which, being the last item in macro 1, thereby effectively terminates macro 1. When macro 2 is finished with its process, I would like to present an option, asking in essence, "do you want to run macro 1 again?" The only way I know of doing that is by inserting a "Macro Run" command at that point in macro 2. This does go back to running macro 1 again from the beginning, but the problem is that, when that final text box of macro 1 once again appears, the "Control-right click" trigger for macro 2 is now ineffective, as macro 2 will terminate only once macro 1 has terminated. Hm... going around in circles with this one.
  15. Yes, that option is checked. Cory, I don’t want to waste your time... I suspect there is a logical flaw in my script(s). For now, it appears that my "trim" command, though a klutz, has fixed this particular problem. Thank you, as always.
  16. Next... I am working on a complicated macro, that’s basically parsing text strings in many different ways. One procedure became too complicated in the main macro. So I first constructed it in a macro by itself, and I finally got everything to work in that. It proceeded by my "hard-wiring" a string variable. Then I proceeded testing the new procedure by calling the new macro from my main macro, passing the same string variable to my new macro from the main macro, the one I had hard-wired for constructing the sub macro. One crucial part of the sub-macro is a "Variable Modify String" command whereby part of the text is deleted, from Starting Position 2, up to 99 characters in length. This works perfectly in the sub-macro, if I run it by itself with the hard-wired text string to begin with. But when I comment out the hard-wired text string, and instead pass the identical string variable from the main macro to the sub-macro, the process fails. I cannot figure out why. I’ve checked to see what the length of the text string is that Macro Express thinks it is, before the text deletion. When run by itself, the sub-macro returns "1". But when called by the main macro, the sub-macro then returns "2," even though the string is only one character long. I’m not posting anything here script-wise yet, as the whole thing is very convoluted. Just out of curiosity, though: are there some pitfalls I need to consider? I have analyzed and re-analyzed this, and I cannot see why calling the sub macro from the main macro should cause this problem. ADDENDUM: as a desperation move, I just inserted at "trim" modification on the offending text string (the fact that the string length reported being 2 characters long, though only one was visible, led me to investigate). This has now fixed the problem. The remaining mystery, however, is why that string has an added space character, when called from the main macro, but not when called within the sub-macro itself. I just don’t have the energy to troubleshoot this further... but if someone has an idea of the pitfalls, I’d like to hear it. Otherwise... just ignore this post. Cheers!
  17. That’s a good idea. One would have to know which character in the string to look for. The strings can have different numbers of characters (including letters and digits) occurring anywhere in the string. With the IF statement you constructed, one can examine only one character at a time; so you’d have to step through each character of the string in succession (with a procedure to determine when the end of the string is reached). That’s doable. My approach is more of a brute force solution, but it permits examining the entire text string at once to see if anywhere in the string is any letter at all. So "9y3" would be identified immediately. Thanks for all the good ideas!
  18. That’s interesting to know; I will keep that in mind. Here, it’s a non issue, as there won’t be any strings containing more than two digits (by the way, this is music input code manipulation...) acantor’s looping script may well be the most efficacious way of getting the information I need with respect to checking for the presence of digits. A positive result, however, only reveals that digits are present; it does not indicate whether there are digits only, or a mixture of digits and letters. I need to perform manipulations on those items of the array that contain only digits. I really appreciate the constructive feedback! rberg, if that "ingenious solution" should pop into your head... I’ll be happy to find out about it. I dreamed of a solution to my code the other night. When I awoke, that solution was not re-constructible... 😉 Too bad one cannot construct a loop like acantor’s digit loop for all the letters of the alphabet (there is no secret "increment" way of cycling through all letters, is there?). And more thinking out loud... perhaps, at the beginning, like "declarations," one could "hardwire" an array, with each consecutive item of the array assigned the next letter in the alphabet, like: Variable Set String %checkIfLetter[1]% "a" Variable Set String %checkIfLetter[2]% "b" Variable Set String %checkIfLetter[3]% "c" etc. etc. up to "z" One could then cycle through the items in the array: Variable Set String %x%: Prompt Variable Set Integer %counter% to 1 Repeat Until %checkIfLetter[%counter%]% Equals "z" If Variable %x% Contains "%checkIfLetter[%counter%]%" Text Box Display: "%x%" contains letters Macro Stop End If Variable Modify Integer %counter%: IncrementEnd Repeat Text Box Display: "%x%" does NOT contain letters Just thinking...
  19. I was afraid there wouldn’t be a straightforward approach. Thanks for the tips. For now, I have coded as follows: The string variable I need to check is %pitchesAndRests[%counterPlusOne%]%. I convert it to an integer and then compare the integer to the string. If they are identical, then I know that the string item consists of digits only. Conversely, if they were not identical, I would know that there are other characters, but I would not know if there is a mixture of numbers and letters. I know I could solve this in an "annoying" way... was just hopeful that some of the brilliant people here might have an ingenious solution that I can’t see... Thanks again, everyone!
  20. Hm... how would I evaluate each character and get it to return a value representing the type? It seems like this shouldn’t be hard. I discovered that if I convert a string to an integer, for instance: "1cd" the integer returns "1", i.e. stripping out the letters. I could then check if the integer variable equals the text variable - where that is the case, I know that the text item contains only numbers... As I am typing this it makes me wonder... as converting "1cd" to an integer yields "1" I then know that the string does not contain only digits. That’s fine as far as it goes. But it wouldn’t tell me, for instance, if the text string contains only letters. For instance, converting "0abc" and "abc" to an integer yields "0" in both cases. But one text string contains only letters, the other one also contains a zero.
  21. A text string array can contain items consisting only of letters, or of letters and digits, or of digits only. Example: 33e re 33e r BARLINE 33e 30q 8ts[[ 9ts 8]] BARLINE 6[ 8 30[ 33]] BARLINE 31[ 9] rq BARLINE 34e re 34e r BARLINE 34e 31q 9ts[[ 30ts 9]] BARLINE Stepping through each text item of this array for evaluation is not the issue. The question is: How can I quickly ascertain if an element contains number(s) only? Or whether an element contains letters only (i.e. no special characters, such as "[" ).
  22. Yes, nothing in Spam. I opened an smtp-pulse account, no luck yet, Cory, but will try to work this out. If it works for you, it should work for me. This would be quite cool... thanks for staying engaged! I’ll update the thread, as (and if) i make progress.
  23. Thanks for the feedback so far. I am trying SMTP-Pulse at the moment; so far, no success... My aim is a simple one: I have one particular macro that works with a 16-bit DOS program (yes!), running in DOSBox, that processes any number of files in succession, but depends on keyboard input being piped into the program. For this reason, when this macro runs, my computer is captive; I can’t work on anything else, as the next keyboard input string then would not properly pipe into the DOS program when the macro executes the next iteration. So I tend to go off and do something else (coffee break - whatever). I would like ME to notify me by email when the process is completed. It’s cute, I know... but still, I’d like to get this to work. Thanks to Cory (as always) and rberg. If I find a solution, I’ll post again. Or if anybody else knows something, I’d love to find out. Cheers.
  24. I have been unable to configure the email settings in preferences to allow me to send an outgoing email via my googlemail account. I applied the following settings: Host: smtp.gmail.com Port: 465 The system requires authentication: check. (Entered my username and password). The macro executes, takes a few seconds, then returns: "The message could not be sent. ’Connection Closed Gracefully.’" I did try Port 25, though I don’t believe that’s the correct setting. I noticed, in the gmail SMTP instructions: Gmail SMTP TLS/SSL required: yes. I see no option for specifying anything like this in the email settings. I have always wanted to use the send email feature, but have never been able to do so. Perhaps it isn’t possible with gmail? Any advice, anyone? I couldn’t find a "gmail" specific discussion here in the forum. Many thanks!
×
×
  • Create New...