Jump to content
Macro Express Forums

kevin

Admin
  • Posts

    1,950
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by kevin

  1. Icebox, Try adding a Delay to the top of the macro. It may be that the Ctrl key is taking a moment to be released. Start with a fairly long delay and, if it works, shorten it. Another thing to try is to add a "Sound Wave" or "Sound Beep" command to the top of the macro. This will let you determine if the macro is being activated. If it is not being activated, then we need to look in a different direction. Of course, the Sound command can be removed later.
  2. Daviejr: An .INI or initialization file (pronounced either 'eye-en-eye' or 'inny') is generally used to store configuration information for Windows or a program that runs on Windows. Once widely used, many programs now use the Windows Registry instead of an .INI file. It is likely that you will find many .INI files in the Windows folder on your computer. An .INI file can be used to read information from an existing .INI file but it is also a convenient way to save and retrieve macro variables. The "Variable Modify String: Save %T1% to INI File" command saves a macro variable to an .INI file and the "Variable Set String %T2% from INI File" reads information from an .INI file and places it into a variable. To understand how to use these commands, you need to understand the structure of an .INI file. An .INI file contains one or more 'Sections'. Each section is given a name and is stored within square brackets, '[' and ']'. Under each section are 'keys' and 'values' separated by an equals sign, ('='). An .INI file may contain many sections but each section name must be unique. Likewise, a section in an .INI file can contain many keys but each key name within a section must be unique. However, keys with the same name can be placed in different sections in an .INI file. The .INI file syntax looks like this: [sectionName1] param1=string param2=string [sectionName2] param1=string param2=string Here is an example from an actual SYSTEM.INI file found in the Windows folder of a computer: [drivers] wave=mmdrv.dll timer=timer.drv [386enh] woafont=dosapp.FON EGA80WOA.FON=EGA80WOA.FON EGA40WOA.FON=EGA40WOA.FON CGA80WOA.FON=CGA80WOA.FON CGA40WOA.FON=CGA40WOA.FON This example contains two Sections, "drivers" and "386enh". The "drivers" section contains two Keys, "wave" and "timer". The Key "wave" has a Value of "mmdrv.dll". The "Variable Modify String: Save %T1% to INI File" and "Variable Set String T2% from INI File" commands require that you specify a filename, a Section Name, a Key Name and a string variable (T1 through T99). When you use the "Variable Modify String: Save %T1% to INI File" macro command, the content of the variable is written as the value of the specified Key. When you use the "Variable Set String %T2% from INI File" macro command, the value of the specified Key is read and placed into the specified variable.
  3. I can't say why the Run dialog is not accepting text input. Perhaps it does not have focus or the 'cursor' is not in the field? You may have better luck using a batch file. Put the net start commands in a text file with a .bat extension. Then use the Program Launch command to run it.
  4. In testing this, I noticed that the Control variable contains the title of the window. If I click on the 'Display Control Info' button in the Get Control dialog, it says: Insight Software Solutions - All Products - Microsoft Internet Explorer - [iEFrame] msctls_statusbar32 - [index: 22] The "Insight Software Solutions - All Products - Microsoft Internet Explorer" part is from the Window Title. This means that you need a different control for each page. There are three techniques to accomplish this. 1. Use a separate 'Get Control' command for each web page. 2. Use a single Window Control but alter it as the macro runs using the 'Variable Set Control Text' command. Something like this might work: Variable Set String %T3% from Window Title Variable Set Control Text %C1% to "%T3% - [IEFrame]" Some experimentation may be necessary. 3. If you know the position of a Window Control you can use the 'Capture Control' command. This command is designed to set a control variable as a macro runs instead of when you are writing the macro. You can calculate the position of the status bar on a window using the 'Variable Set Integer from Top of Window', 'Variable Set Integer from Left of Window', 'Variable Set Integer from Width of Window', and 'Variable Set Integer from Height of Window' commands. If I were writing this macro, I would lean toward technique #3.
  5. Gerry, Use the "Net Use" command at a Command Prompt (or MSDOS prompt): Syntax: Net Use [devicename | *] [\\computername\sharename[\volume] [password | *] [[/DELETE] | [/PERSISTENT:{YES | NO}]] To map a drive letter with a non-persistent connection: Net use v: \\Insight-server\c To map a drive letter with a persistent connection: Net use v: \\Insight-server\c /persistent:yes To disconnect a drive Net use v: /Delete Command Help: To view help for the Net Use command type "Net Use ?" at a Command Prompt. Enter a Net Use command in either a command prompt or the Run dialog.
  6. Gerry, After a Google search I learned that the correct name of this option is "Use Simple File Sharing". For XP Home, this is the only option. For XP Pro, it is enabled by default. For a brief description of what 'Simple File Sharing' is and how to change it, visit this web page: http://compnetworking.about.com/cs/winxpne...ht/winxpsfs.htm Microsoft has this option off by default and where you change the option it is described like this: "Use Simple File Sharing (Recommended)" In spite of Microsoft's recommendation, I have read several articles that say Simple File Sharing should be disabled. You say The authors of the above mentioned articles would probably point out that, since you connect to the Internet, you share your computer with every other person on the Internet and thus should turn off Simple File Sharing. At this time I do not know why you cannot just select the 'Use Default Name and Password' option to make a connection on a network with Simple File Sharing enabled. We will research the issue.
  7. Hi Bernhard, I would recommend the Repeat with Folder command. You could append each filename in the folder to the a file containing the file names. Something like this:
  8. Icebox, There are some dialogs that 'freeze' macros. Our research indicates that when certain dialogs are active, Windows is not letting Macro Express run. I also suggest trying the "If File Ready", "If File Not Ready" or the "Wait File Ready" commands.
  9. I am using Windows XP Pro with simple networking disabled. Some of the Network Connect commands in the example macro have 'Make Connection Permanent' checked while others do not. One thing that I had to do was to enter my login name and password. When I left 'Use Default Name and Password' checked, the connections failed. Once I tested the macro and made sure it was working I unchecked 'Display Connection Status' in all the Network Disconnect and Network Connect commands. You probably don't care if the Network Disconnect fails because the most likely cause of failure is that the drive wasn't mapped in the first place. So, if it fails it doesn't matter, and if it doesn't fail, then the drive is removed. Either way, the drive mapping is gone.
  10. Gerry, If I am not sure whether or not a drive letter is already mapped, I do a Network Disconnect and then a Network Connect. By the way, I also use this technique when using batch files to make network connections. Yes, this is information only. It just shows which drive letters have already been mapped. Macro Express tells Windows to map the drives on startup. Whether you use Windows Explorer or Macro Express to map a permanent drive, the result is the same. That is what I would do. You can disconnect any drive, even those that have previously been mapped with "make connection permanent". The macro would look something like this: Network Disconnect: M: Network Connect: M: to \\server-xyz\htdocs Network Disconnect: N: Network Connect: N: to \\server-xyz\In Network Disconnect: O: Network Connect: O: to \\server-xyz\inout Network Disconnect: P: Network Connect: P: to \\server-xyz\private
  11. Macro Express does not support Unicode. However, some people have used Macro Express with Asian languages by copying the text and pasting into the Text Type command. We do not know under what circumstances this works or does not work.
  12. Have you tried the "Network Connect" macro command? This may do what you need.
  13. Yes, it is common to use the registry instead of a file to hold information. Many of the macros I write do this and, I understand that the PGM Functions Library from Professional Grade Macros uses the registry extensively. Several of my macros look for a value in the registry. If it isn't there we know the macro has not been used previously and the macro asks for specific information like the user name and preferences.
  14. That does not work because the Macro Express Player also has a window named 'Macro Express'. The statement: If Window Title "Macro Express" is running will always be true. You have two choices. Change the window title to "Macro Express -": If Window Title "Macro Express -" is running Activate Window: "Macro Express -" Else Macro Run: Run Macro Express Editor End If Note that you need to activate the window "Macro Express -". Otherwise you may be activating the player's window which will seem to do nothing. Or, replace everything with this: Macro Run: Run Macro Express Editor On my system the 'Activate Window' is unnecessary.
  15. Yes, I should have said 'Variable Set from Misc'. Macro Express does not have a direct way to determine if the logged on user has administrative rights. However, knowing which user logon names have administrativer rights you can do something like this: Set Variable %T1% to "Username" If Variable %T1% = "Aministrator" OR If Variable %T1% = "Greg" // <Do your Admin stuff here> Else // <Do your non-admin stuff here> End If You have your macro determine if the currently logged on user has administrative rights by attempting to write to a 'protected' area of the registry. If the write is successful, then the user does have admin rights. For example, you may try to write to: HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\TestValue
  16. Normally Windows does not accept keystrokes and mouse clicks in anything but the active window. But, you can write a macro using Window Controls that send keystrokes and mouse clicks to a specific Control. This may even work on a application that is minimized or hidden. There are limitations, however. A control can be a button, an input field or a form. The application you are automating, not Macro Express, determines what is and what is not a control. How the application is written also determines whether or not a control will accept mouse clicks or keystrokes. It is also up to the application whether or not it responds when the application is minimized or hidden. There is a tutorial in the Macro Express help that discusses Window Controls.
  17. Some programs respond to alt sequences in unusual ways. But, because of the flexibility of Macro Express, I can think of several approaches that should work. Hold the ALT key down, delay for a moment, and then let the ALT key up. Activate Window: "ProCD PhoneBooks - Great Lakes+North Central" Text Type: <ALTD> Delay 20 Milliseconds Text Type: <ALTU> Delay 20 Milliseconds Text Type: v This macro does the ALT key down and up using specific commands. Activate Window: "ProCD PhoneBooks - Great Lakes+North Central" Alt Key Down Delay 20 Milliseconds Alt Key Up Delay 20 Milliseconds Text Type: v But this last example is the simplest. It uses the 'double alt' technique discussed in the routine that captures macros. Activate Window: "ProCD PhoneBooks - Great Lakes+North Central" Text Type: <ALT><ALT>v
  18. You said: This macro would do that for you. Activate Window: "ProCD PhoneBooks - Great Lakes+North Central" Text Type: <ALTD> Delay 20 Milliseconds Text Type: <ALTU> Delay 20 Milliseconds Text Type: v
  19. On some systems Windows is not ready to allow macros to run as soon as Macro Express is loaded. Try the option to delay loading Macro Express found in Options | preferences | Startup. Make sure the checkbox on the line under "Run on Windows' Startup" that says: [ ] Wait for [ ] seconds is checked and enter some number of seconds. I would try a high value at first like 45 seconds. If it works, reduce the number of seconds down until you reach a more acceptable value.
  20. Dave, You cannot remove or disable the close button on the floating menu. However, have you thought about creating a macro that runs when Macro Express loads and have that macro enable the floating menu? To do this: 1. Create a Scheduled Macro 2. For the schedule, choose either 'At Startup' or 'Load File' 3. In the macro put a 'Macro Enable: floating menu' command (substitute 'floating menu' with the name of your floating menu macro) The 'At Startup' option will run the macro when Macro Express first runs. If Macro Express is automatically loaded when Windows is loaded (see Options, Preferences, Startup, Run on Windows Startup), then the macro will run when Windows is loaded. The 'Load File' option will run the macro whenever the macro file containing the macro is loaded into Macro Express. If you only use one macro file then the schedule option 'Load File' will work the same way as the 'At Startup' option. However, if you use multiple macro files, then this option will cause the 'enable floating menu' macro to run each time the macro file is loaded.
  21. Hi Greg, One thing you can do is customize macros for each login. Use the 'Variable Get from Misc' command and choose 'User Name'. I have a macro that does an online lookup of school grades. Each person who logs in can quickly see their own grades and Mom or Dad get a menu to choose which one to view. Another similar macro uses our library's online system to find out what books are checked out, when they are due, and any fines owing. These are simple but useful things.
  22. Markter, You can use either the Switch/Case set of commands or the If Variable/Else set of commands. Using Switch/Case took 37 lines of macro commands (excluding comments). Using If Variable/Else took 46 lines of macro commands. These examples depend on the variable for months 1 through 9 containing a leading '0' (eg: 01 - 09). If the value does not contain a leading 0 then you will need to adjust the macro commands. The Switch/Case technique looks like this: Switch (T1) Case: 01 Variable Set String %T2% "Jan" End Case Case: 02 Variable Set String %T2% "Feb" End Case Case: 03 Variable Set String %T2% "Mar" End Case Case: 04 Variable Set String %T2% "Apr" End Case Case: 05 Variable Set String %T2% "May" End Case Case: 06 Variable Set String %T2% "Jun" End Case Case: 07 Variable Set String %T2% "Jul" End Case Case: 08 Variable Set String %T2% "Aug" End Case Case: 09 Variable Set String %T2% "Sep" End Case Case: 10 Variable Set String %T2% "Oct" End Case Case: 11 Variable Set String %T2% "Nov" End Case Case: 12 Variable Set String %T2% "Dec" End Case End Switch The If Variable/Else technique looks like this: // Same macro using If statements If Variable %T1% = "01" Variable Set String %T2% "Jan" Else If Variable %T1% = "02" Variable Set String %T2% "Feb" Else If Variable %T1% = "03" Variable Set String %T2% "Mar" Else If Variable %T1% = "04" Variable Set String %T2% "Apr" Else If Variable %T1% = "05" Variable Set String %T2% "May" Else If Variable %T1% = "06" Variable Set String %T2% "Jun" Else If Variable %T1% = "07" Variable Set String %T2% "Jul" Else If Variable %T1% = "08" Variable Set String %T2% "Aug" Else If Variable %T1% = "09" Variable Set String %T2% "Sep" Else If Variable %T1% = "10" Variable Set String %T2% "Oct" Else If Variable %T1% = "11" Variable Set String %T2% "Nov" Else If Variable %T1% = "12" Variable Set String %T2% "Dec" End If End If End If End If End If End If End If End If End If End If End If End If
  23. Another technique that I have used is to store personalized information in the registry. I have a macro that reads values from the registry. If the values do not exist, a macro is launched to collect the information. This way, the first time, and only the first time, they run the macro, it asks them for personalized information (name, login name, password, etc.). You could also add an option to run the macro that collects the personalized information at any time. This would allow the user to change their information as needed. The one weakness to this technique is that the password stored in the registry is not encrypted. You could, however, combine this technique with the one described by Icebox. The password could be set using the 'Encrypted Text' command at the top of the macro. The macro could determine if the password has been changed and prompt the user to change it. Other non-sensitive information could be stored in the registry. Another thing you might want to try is to use the Windows log-in name. This can be read using the Variable Set from Miscellaneous command.
  24. Macro Express v 3.5c containing a fix for this issue has just been released. Download it from http://www.macros.com/download.htm. View a complete list of changes in this version here: http://www.macros.com/rev3_5c.htm
  25. Macro Express v 3.5c containing a fix for this issue has just been released. Download it from http://www.macros.com/download.htm. View a complete list of changes in this version here: http://www.macros.com/rev3_5c.htm
×
×
  • Create New...