Jump to content
Macro Express Forums

All Activity

This stream auto-updates

  1. Yesterday
  2. I don't think so. But you can open multiple scripts at the same time, with the proviso that each script must be selected individually in Macro Express Explorer to open it. You can switch between scripts in the Script Editor either by clicking on the tabs in the bottom left corner of the screen, or via two hotkeys: Ctrl + Alt + right arrow and Ctrl + Alt + left arrow.
  3. The online Help* says that to remap the keyboard: 1. From the Macro Explorer, select Tools > Remap Keyboard. 2. The Remap Keyboard window will activate. However when I do this the Remap Keyboard window does *not* appear. It also says: Note: Click on Options > Preferences > General and select the Miscellaneous tab to disable the Keyboard Remapping feature. It shows a screenshot Close open .... Disable keyboard remapping Delete temporary... However when I follow these instructions there is no "Disable keyboard remapping" option. How can I remap the keyboard? Thanks for any suggestions. Version: Macro Express Pro 6.3.3.1 * https://www.macros.com/helppro/Index.htm?context=3240
  4. Last week
  5. Is it possible (HOW ?) to have a second instance of the Editor open for copying good ideas from an existing one, to one-in-the-making ?
  6. Earlier
  7. That is so far above my usage, I simply have to take your word for it; but on a general level, I can accept that macros can build more intelligence into processes than batch files can.
  8. Sometimes ME can dynamically build (then run) the simple line of code, or the whole batch file. That's not needed if the batch commands do exactly the same thing every time, but it is useful if the batch does the same "function" but with variable data. For example, macro 1 runs a standard directory list with output to a text file; macro 2 reads back the text, analyzes data file sizes, builds a different "copy" command batch file for each data file based on how big the file is today and whether the backup should be compressed or not; macro 3 runs the copies a few at a time to avoid overloading the server. (That's a real application, as you may have guessed.) In other words, macros can utilize the simple and efficient batch commands, while applying logic and intelligence that otherwise would be lacking.
  9. "its constraints spark creativity. " amply demonstrated by complex code that can be replaced by one line in a batch file. Incidentally, I've used up all the available keys with Left-Win and Right-Win for text string entries. I think that has exhausted my potential use of Autohotkeys.
  10. Hi Sebastian, My impression is that the Macro Express aficionados who haunt this forum gravitate to Macro Express not because it's a super-efficient, leading-edge programming environment, but because it's a useful, interesting, and quirky tool that non-programmers can sink their teeth into and get excellent results. Many if not most people who are "into" Macro Express, I would guess, understand, accept, and even embrace its limitations. Macro Express is almost always my first choice when there's a task I want to automate, simplify, or improve. That's because I can often create working prototypes in minutes. But I don't use Macro Express for everything. For some tasks, other tools are clearly better. For example, I once automated a task using AutoHotkey, and using Macro Express. The AutoHotkey version runs in the blink of an eye, while the Macro Express version runs in slow motion. Although the AutoHotkey version is more practical, I sometimes opt to use the Macro Express version because I'm proud that I was able to make it work, despite Macro Express's constraints. The beauty of Macro Express, for me, is that its constraints spark creativity.
  11. Since I thought I had come to the end of the road in Macro Express, and was going to run the macro from a batchfile anyway, I've explored doing the data copy by batch file code, and with help from someone in the Microsoft Community, I've been able to achieve that with one very simple line of code, which HAS to be preferable to the more complex code suggested in the previous post. Thank you anyway.
  12. Sebastian, As was mentioned above you could use Macro Express commands to copy all files and folders in the Data folder to another folder. This example copies the files and folders from the folder Data to a folder that contains the date, e.g. E:\Data --> E:\Data09092021 while leaving the original Data folder intact. Variable Set String %SourceDir% to "E:\Data" Variable Set From File date Variable Set String %DestinationDir% to "E:\Data%FolderDay%%FolderMonth%%FolderYear%" Copy File/Files: "%SourceDir%\*.*" to "%DestinationDir%" <VARIABLE SET STRING Option="\x00" Destination="%SourceDir%" Value="E:\\Data" NoEmbeddedVars="FALSE"/> <VARIABLE SET FROM FILE Filename="%SourceDir%" Option="\x00" Date="\x01" Month="%FolderMonth%" Day="%FolderDay%" Year="%FolderYear%" Flags="\x07"/> <VARIABLE SET STRING Option="\x00" Destination="%DestinationDir%" Value="E:\\Data%FolderDay%%FolderMonth%%FolderYear%" NoEmbeddedVars="FALSE"/> <COPY FILE/FILES Source="%SourceDir%\\*.*" Dest="%DestinationDir%" Progress="TRUE" Recurse="TRUE"/> If you want to rename the Data folder you can use the following. This example moves the files and folders from the folder Data to a folder that contains the date, e.g. E:\Data --> E:\Data09092021 . The original folder E:\Data is removed. Variable Set String %SourceDir% to "E:\Data" Variable Set From File date Variable Set String %DestinationDir% to "E:\Data%FolderDay%%FolderMonth%%FolderYear%" Rename File/Files: "%SourceDir%" to "%DestinationDir%" <VARIABLE SET STRING Option="\x00" Destination="%SourceDir%" Value="E:\\Data" NoEmbeddedVars="FALSE"/> <VARIABLE SET FROM FILE Filename="%SourceDir%" Option="\x00" Date="\x01" Month="%FolderMonth%" Day="%FolderDay%" Year="%FolderYear%" Flags="\x07"/> <VARIABLE SET STRING Option="\x00" Destination="%DestinationDir%" Value="E:\\Data%FolderDay%%FolderMonth%%FolderYear%" NoEmbeddedVars="FALSE"/> <RENAME FILE/FILES Source="%SourceDir%" Dest="%DestinationDir%" Progress="FALSE" Recurse="FALSE"/> NOTE: the folder names cannot have a trailing "\" or contain "\*.*" When they do the copy or rename does not work correctly. I used the folder's modified date to create a destination folder like E:\Data09092021. I did not include hours and minutes in the destination folder name. You can easily add these. You could also choose to use the date/time when the macro runs, similar to what you have above.
  13. Alas, the DATA folder that I want to copy is full of folders.
  14. I'm not sure how to copy an entire folder. But it's possble to copy the content of an entire folder: Copy File/Files: "C:\Users\Alan\Documents\Test\*.*" to "C:\Users\Alan\Documents\Test\Testing\" <COPY FILE/FILES Source="C:\\Users\\Alan\\Documents\\Test\\*.*" Dest="C:\\Users\\Alan\\Documents\\Test\\Testing\\" Progress="TRUE" Recurse="FALSE"/> Star-dot-star is a wildcard that represents all files contained in folder C:\Users\Alan\Documents\Test If you only need to copy a single file, you can do the following, which copies the file called "File.txt" into the "Testing" sub-folder. Copy File/Files: "C:\Users\Alan\Documents\Test\File.txt" to "C:\Users\Alan\Documents\Test\Testing\" <COPY FILE/FILES Source="C:\\Users\\Alan\\Documents\\Test\\File.txt" Dest="C:\\Users\\Alan\\Documents\\Test\\Testing\\" Progress="TRUE" Recurse="FALSE"/>
  15. My predicted return is realised. To finish the job of this macro, I now want to copy C:\data to A:\ The Files/Folder category has a 'copy files' but no 'copy folders'. How to construct the code to do THAT ?
  16. It did not fail after that tweak. Thank you. I'm sure I'll be finding refuge with you again before long.
  17. There's a lot to learn of while getting comfortable with Macro Express. Your learning curve is typical! The second field from the top is currently blank. Macro Express needs to know the name of the variable that will store the date. The variable name I suggested in my original response was %Date%. So in the second field from the top, type in: %Date% Alternatively, click the "Variable" button next to the field. If you navigate around enough, you may find it there. Or you may be forced to create a new text variable. Overall, through, I think it's easier just to type %Date% in the field. If the variable %Date% doesn't exist, Macro Express will prompt you to create it when you save the macro.
  18. Macro Express is a hard Task Master - VERY hard to please.
  19. You are so on the right track! Change the value in the drop-down list from: "Type the date/time stamp out" to "Store the date/time stamp as a variable" The item currently selected outputs the date as though you were typing it. The item you want stores the date. By storing it, you can output the date twice: first, when you rename the file, and second, when you move the file.
  20. I have experimented as best I could. If I am on the right track, there is the new obstacle of the dialogs not accepting any text, so I can not enter '%Data%'.
  21. 'Data' is the name of a folder, so no extension is required. Will report back after I have fixed 'variable'; Up to now variables have only perplexed me; maybe I'll gain more understanding today.
  22. The variable %Date% in Line 1 is not defined. Edit the instruction, go to the "Operations" tab, and choose to store the date as text variable %Date%. Line 3 renames a file called "a:\Data". But is that really the name of the file? If the file name has an extension, you must include it in the file name: Data.txt, Data.doc, Data.xml, or whatever.
  23. Direct Editor was already NOT ticked. My code now is <DATE/TIME Format="yyyymmdd" Flags="\x30" Date="5/9/2021 11:52:04 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" IsDateVar="FALSE"/> <DELAY Flags="\x01" Time="1"/> <RENAME FILE/FILES Source="a:\\Data" Dest="a:\\%Date%" Progress="FALSE" Recurse="FALSE"/> <DELAY Flags="\x01" Time="1"/> <MOVE FILE/FILES Source="a:\\%Date%" Dest="a:\\DataOld\\%Date%" Progress="FALSE" Recurse="FALSE"/> <DELAY Flags="\x01" Time="1"/> <MACRO STOP/> But it is still ineffective.
  24. I don't think the lack of delays is the problem, although short delays may be needed in the end. Here are the issues that are preventing the macro from working that I've spotted: Line 2: This is not a statement that sets a variable. It's a statement to type out text. Delete the line, and recreate it from scratch: Variables > Date/Time. Lines 4 and 6: There are quote marks around the file names that shouldn't be there. Edit the lines and delete the quote marks from the files names. In other words, change: "a:\Data" to a:\Data Also, these changes will be easier to do with "Direct Editor" mode toggled OFF. Not sure if this is what is what is happening, but thought I'd mention it. This setting is in the "View" menu in the Script Editor.
  25. Much simpler but mush less effect than my attempt. <LOCK PLAYER Wait="TRUE"/> <TEXT TYPE Action="0" Text="Date/Time: Set %Date% to the current date/time using \"YYYY-MM-dd\" as the format\r\n\r\n"/> <DELAY Flags="\x01" Time="1"/> <RENAME FILE/FILES Source="\"a:\\Data\"" Dest="\"a:\\%Date%\"" Progress="FALSE" Recurse="FALSE"/> <DELAY Flags="\x01" Time="1"/> <MOVE FILE/FILES Source="\"a:\\%Date%\"" Dest="\"a:\\DataOld\\%Date%\"" Progress="FALSE" Recurse="FALSE"/> <DELAY Flags="\x01" Time="5"/> <MACRO STOP/> Could it be that there is an excess of " ? I'm also surprised to see double slashes...
  26. Looks so much easier ! I could not create a new macro for some reason, so copied an existing one and disembowelled it, by deleting its contents and replacing it with your code. I modified where your guesses did not match my system. It failed. I guessed that time delays may be required between the steps. I'm working on putting those last steps into proper format.
  27. Might it be possible to rename and move using Macro Express commands? Manipulating a user interface to perform these tasks might get flaky! Maybe something like this untested example? Date/Time: Set %Date% to the current date/time using "YYYY-MM-dd" as the format Rename File/Files: "c:\tmp\Data" to "c:\tmp\%Date%" Move File/Files: "c:\tmp\%Date%" to "c:\DataOld\%Date%"
  28. I did not get notification of your reply so spent much time experimenting and found your first P.S. to be the case. The aim of the macro is to select the folder called Data, change its name to a date, and then move it into a folder called Data Old. I did a work around using the mouse location and clicks and got surprisingly far, but Macro Express never fails to trip me up somehow. I include the full macro text - which works (reliably) up until the last stage (Pasting) where it surprises me with an outlandish claim shown in the attachment : I might observe that the last step somehow causes the 'name-changed-folder' to become selected again; and so it must look to Macro Express that I am trying to paste it into itself. <LOCK PLAYER Wait="TRUE"/> <COMMENT Value="Open A:\\"/> <OPEN FOLDER Path="A:\\"/> <WINDOW ACTIVATE Title="A:\\" Exact_Match="FALSE" Wildcards="FALSE" _IGNORE="0x0006"/> <DELAY Flags="\x01" Time="0.5"/> <COMMENT Value="7 TABs to select \\Data\\"/> <REPEAT START Start="1" Step="1" Count="7" Save="FALSE"/> <TEXT TYPE Action="0" Text="<TAB>"/> <DELAY Flags="\x01" Time="1"/> <END REPEAT/> <COMMENT Value="Space to change from selection to Focus"/> <TEXT TYPE Action="0" Text="<SPACE>"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="Move the mouse over the word Data"/> <MOUSE MOVE Option="\x02" X="250" Y="225" _PROMPT="0x000A"/> <DELAY Flags="\x01" Time="1"/> <COMMENT Value="Left-click to select text"/> <MOUSE LEFT CLICK/> <DELAY Flags="\x01" Time="2"/> <DATE/TIME Format="20yymmdd" Flags="\x30" Date="5/9/2021 1:30:28 PM" Day_Offset="0" Month_Offset="0" Year_Offset="0" Hour_Offset="0" Minute_Offset="0" Second_Offset="0" Left="Center" Top="Center" Monitor="1" IsDateVar="FALSE"/> <COMMENT Value="Enter to confirm"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="2"/> <COMMENT Value="Right-click to expose Cut"/> <MOUSE RIGHT CLICK/> <DELAY Flags="\x01" Time="2"/> <COMMENT Value="Down arrow 6 times to select CUT"/> <REPEAT START Start="1" Step="1" Count="6" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>"/> <DELAY Flags="\x01" Time="0.5"/> <END REPEAT/> <COMMENT Value="Enter to effect cutting"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="0.5"/> <COMMENT Value="Down arrow to select 'data old'"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>"/> <DELAY Flags="\x01" Time="0.5"/> <COMMENT Value="Right-click to expose Paste"/> <MOUSE RIGHT CLICK/> <DELAY Flags="\x01" Time="2"/> <COMMENT Value="Down arrow 8 times to select Paste"/> <REPEAT START Start="1" Step="1" Count="8" Save="FALSE"/> <TEXT TYPE Action="0" Text="<ARROW DOWN>"/> <DELAY Flags="\x01" Time="0.5"/> <END REPEAT/> <COMMENT Value="Enter to effect pasting"/> <TEXT TYPE Action="0" Text="<ENTER>"/> <DELAY Flags="\x01" Time="0.5"/> <MACRO STOP/>
  1. Load more activity
×
×
  • Create New...