3. Creating and Editing Macros

This section focuses on the mechanics of creating a macro or editing existing macros. It will probably be of most use to your unit's expert user or users. Coverage includes: activating a macro, creating a macro, analysis of the complex frontlog macro, and the Get Control function.

Effective Date: 
February 11, 2014

Activating a Macro

(MEx=Macro Express)

See also: Using a Macro to Select/Change an Index

To activate the macro Search Staff Name Headings Search:

1. On most workstations that have MEx loaded, MEx is started automatically when the user logs on to Windows; the MEx icon should be in the program tray, usually at the bottom right of the window.

What you want to do is to open the MEx Macro Explorer window by clicking on the MEx icon in the program tray. The MEx Macro Explorer window will open.

2. The MEx Macro Explorer window has the standard menus and toolbar at the top of the window common to many Windows programs. Note also the three vertically tiled subwindows or columns: Actions, Categories, Macros. In the Macros subwindow, check the title bar to verify that you are using one of the 2 master files released with the Dec. 2006 push, MASTER3N.mex or MASTER3D.MEX. Make sure the file is located in the standard path: C:\Program Files\Macro Express 3. (We've found some workstations where the file was in the Eudora Attachments folder).

The macros have been organized in folders listed in the Categories subwindow. Select (left click) the Search & Import folder; the Macros in this folder will display in the Macros subwindow. The Macros subwindow is organized in 4 columns: Nickname, Activation, Scope, Modified. Clicking on Nickname at the top of the column will sort the macros by name; clicking on Activation will sort the macros by hot-key. You want to find the Search Staff Name Headings Search macro. Since there are 50+ macros in this folder and most of them have been assigned No Activation, your best bet is to search by nickname.

3. Click on Nickname, then scroll down to Search Staff Name Headings Search. Note that under the Activation column, the macro Search Staff Name Headings Search has No Activation. Double click on Search Staff Name Headings Search.

The MEx Scripting Editor window will display.

This window also has the standard menu and toolbar, along with 3 vertically tiled subwindows or columns: Actions, Commands, Macro Script. Above the Commands column note especially 5 tabs: Script, Properties, Scope, Security, Notes.

4. Click on the Properties tab. Two vertically tiled subwindows or columns will appear, General and Activation. Note the Hot Key selection box in the Activation window.

5. Click in the Hot Key selection box. The grayed-out Set Hot Key button will be activated and the default hot key sequence, Alt+Shift+Y will appear. Click on the Macro Explorer icon at the top of the Actions column. You will be prompted to save the update; click the Yes button. The Macro Explorer window will reappear. Note that under the Activation column for Search Staff Name Headings Search No Activation has been replaced by Alt+Shift+Y. Close the Macro Explorer window and test the macro.

IN CASE YOU DIDN'T KNOW: closing the Macro Explorer window (clicking the x in the upper right program window) does not close the MEx program. MEx is set up to be running at all times; you should see the MEx icon in the program tray during all of your Windows sessions. If you need to close the program, place the cursor on the MEx icon, right click to open the menu options, and then click Terminate Macro Express.

6. To assign a different hot key, click on the Set Hot Key button once it has been activated. The Set Hot Key Activation window will appear.

set hotkey activation

Type the key sequence in the space provided, or scroll through the list of key sequences and click on the sequence you want to apply. You have to be very careful if you don't accept the default key sequence. We checked most of the default hot keys and they are not in contention with other macro hot keys, Voyager functions, and Windows functions. If you assign a customized key sequence to your macro, it will override any previously assigned macro or native Voyager or Windows function. (Hey, how come my Ctrl+v doesn't work in Voyager anymore?) Check the Complete Macro Express Keyboard Assignments table to make sure the key hasn't already been assigned. Keep in mind:

a. most of the default hot keys under No Activation are in the Alt+Shift+<key> range.

b. most native Voyager commands on the menus use Alt+<key> or Ctrl+<key>; replacing the native Voyager command with another function will not only block the Voyager command, it may also disrupt other macros that include the Voyager command in the macro string.

7. Alternatively, take a look at the Function Key Template and cross check it against the table of basic Macro Express Function Keys. If you can identify a macro that is never used in your workflow, map it to that function key. For example, if you or your staff member never needs to enter 040 CtY$cCtY (Shift+F12), map a macro you expect to be used more heavily to Shift+F12. Note that a number of functions listed on the Function Key Template are native Voyager, e.g. F2, F3, F4, F8, F9--you do not want to map any macro to those keys.

Effective Date: 
February 12, 2014

Creating a Macro (Override Example)

For this tip, we will walk through the creation of this relatively simple macro & demonstrate some features of Macro Express in the process.  Kudos to Roy Lechich, formerly in the Integrated Systems and Programming group, for creating this elegant macro.

1. To begin, we need to determine what it is we want to do.  In this case, we want the program to click the Override button whenever Voyager opens an Item Blocks window during the circulation charging process.  See the Macro Express Tip: Override (Voyager Circulation Module) for context.


2. Next, we need to translate what we want to do into Voyager commands, and translate the Voyager commands into key stroke sequences.  Although Macro Express can map mouse positions, the macro is more reliable when key strokes are used because mouse positions vary depending on window sizing.  There is almost always a Voyager key stroke equivalent for a Voyager command.  The key stroke equivalent for the Voyager override command is Alt+o. (Since Voyager has mapped most of its commands to Alt+<key> sequences, always avoid mapping your macros to Alt+<key<>).


3. From the Macro Explorer window, we go to the menu bar and click on the Macros menu, then click Add Macro .... (Note that we could do the equivalent from the toolbar.  Look for the New Macro icon (usually under Category) and click on it.)

 

4. The Set HotKey Activation window opens:


5. Note that the default activation is Hotkey and that the cursor is prompted to the Select a Hot Key ... Place cursor in the field below ... box.  To map the macro to the F1 function key, simply press the F1 key.  Then click on the Scripting Editor button (upper right of the window).


6. The Scripting Editor window will open.


7. Basically, you want the program to type Alt+o.  This is a Text command.  Click the A Text option in the Command window, and then double click the Text Type option from the submenu:


8. The Text Type window will open.  Record keystrokes in the Keystrokes area blank space.  To enter the keystroke for Alt, click on Alt on the menu below the keystrokes area.  To enter the keystroke for o, type o.  Then click the OK button at the bottom of the window.


9. The first line of the macro now appears in the Macro Script window:


10. However, the macro must only run under certain conditions, i.e. when we are charging items.  For the program, that means that we want the window with Charge in the title header to be running before the macro starts.

To impose this restriction, we first select the Logic command.  From the extensive list of Logic options, double click on the option If Window.

The If Commands window opens.  We select If Window on Top and specify the Window titleCharge.  Note that Partial Match rather than Exact Match has been selected, which means that the macro will work with either Charge or Discharge in the title header.


11. The Macro Script is again on top, but the If condition is out of sequence.


12. Note the arrows on the left and right margins.  The arrows on the left insert commands from the Commands list before, after, or at the end (in that order from top to bottom).  The arrows on the right move lines of macro script up or down.

Since the Charge window is a precondition for the action, we want the condition (If Window Title "Charge" ...) to precede the action (Text Type <Alt>o).  Therefore, we use the position arrow at the right margin to move the If condition before the Text type action.  Clicking on the up arrow will reposition the highlighted line up one line.

Alternatively, we could set the position of the Logic command line in advance.  At step 10. above, we could:

  • single click (select) the Logic command If Window,
  • single click the Text Type line in the Macro Script window (to select the script line we will insert before)
  • click on the first insert arrow (Insert Before) on the left margin (the If Commands window will open as in section 10.)
  • select or enter the same options for the If Commands window as in section 10. and click OK (the macro script line If Window Title "Charge" is on top will appear before the Text Type <ALT> o line).

Note that the macro would still run without the If condition "Charge" on top script line. The condition is more of a safety measure in case there are other Circulation windows where the Item Blocks windows are used.


13. We want the text type action to be performed during the Charging situation only when windows with the title header Item Blocks are on top.  Although an If condition might also work, we choose a Timing command.  This allows us to insert an automatic time-out and also allows us to avoid complicated If conditions, since the Item Blocks window is on top intermittently rather than continuously.  From the Command list we select Timing.  From the list of options under Timing, click on Wait for Window Title.

Since Timing is also a precondition for the action of Text Type, but subordinate to the more general Charge condition, we want to insert it after the If condition but before the Text Type.  Make sure the If Window line is highlighted (selected) and then click on the 2nd insert button (insert after).  The Wait for window will open.


14. From the Wait For window, we select Wait for Window Title to Appear, identify the Window title (Item Blocks and Information) and provide a Wait a Maximum of2 minutes 15 seconds.  Because the macro does not close upon completion, it is important to provide a limited time out period.  Click OK.


15. The Macro Script now appears with a Wait for Window title line.  Since we predefined the insertion point, the Wait for Window Title script line appears after the If Window Title script line and before the A Text Type script line.

Alternatively, we could have double clicked on the Wait for Window Title command option to open the Wait for window, selected or entered the options, clicked OK, and used the positioning up arrow to move the Wait for command line before the A Text Type line.


16. The command syntax requires that you indicate the limit of the If condition.  We go back to the Command options to find and click on Logic again.  This time we select End If and double click.  Since there are no suboptions under End If, the End If command line is placed at the end of the Macro Script.

At this point, the macro will run once and then stop under the conditions we have specified.  If the Item Blocks window appears more than once during the charging process (and this is common on many units' workstations), the macro will stop after overriding only the first block, and the item will not be charged.  The macro will only be useful if we can get it to run repeatedly without having to hit the hot key over and over again.  In order to get the macro to run repeatedly once we have started it, we now want to insert the Repeat command.


17. We select Repeat from the list of Commands and then select Repeat Start for the option.  We want the conditions and actions to nest within the repeat, so first select the first line of the Macro Script (If Window Title Charge ...) and then click on the first insert arrow (insert before).


18. The Repeat Options window opens.  The default command is Start Repeat, which is what we want.  However, note that the Repeat Count default is only 10.  We don't want to re-start the macro after only 10 charges, so we simply add a 0 to the count to boost it to 100 and click OK.  (No other changes need to be made in this window).

NOTE: we can easily revise the Repeat Count on the finished macro.  From the Macro Explorer, find the macro item line Override in the Circulation folder and double click on it to open its Macro Script.  Double click on the Start Repeat line in the macro script to open the Repeat Options window, type in a new Repeat Count, click OK, and save the change.  (See Section 25 for different ways to save a macro).


19. To properly nest the macro within the Repeat condition, we need to script in where to end the condition.  From the Command list, we again select Repeat, and from the list of options under Repeat, we double click on Repeat End, which will be inserted at the end of the script. (No insert arrows needed).  The Macro Script for the Override macro looks like this:


20. Now that we have created the macro, we need to name it & scope it.  We name the macro by clicking on the Properties tab above the Commands subwindow:


21. The Properties window opens.  We type in a name for the macro, in this case Override.  Note that the Hot Key has already been activated. (Step 5.)  We click on the Scope tab.


22. The Scope window opens. The default scope is Global; it should be changed to Program Specific (click on the radio button). You never want your macro to run in all programs, i.e. globally; the macro should always be program specific (although in some cases you may want to run it in more than one program--but never globally).  Clicking on the Program Specific radio button will un-gray the Select button next to it, which we then click.


23. The Select Programs window opens.  We only want the macro to run in the Voyager circulation module, so we use the scrollbar in the left subwindow to find and select CIRCULATION.EXE.  We then click on the Add button (either will work) so that CIRCULATION.EXE appears under Select from a list of installed programswith Run if on top checked below.  We then click the OK button.


24. It is important to remember that the macro has not yet been saved.  There are a number of ways to save the macro:

  • Click on the File menu and then click on Save
  • Click on the corresponding save icon on the toolbar
  • Click on the Macro Explorer icon in the Actions column (you will be prompted to save the macro)

25. Testing should be an integral part of macro creation.  The macro distributed in January 2005 looks like this:

Note the extra lined out If Window title ... condition.  Different If Window Title ... conditions were tested.  A nice feature of Macro Express allows the user to disable multiple lines of script without deleting them.  The macro is saved in the lined-out version, and tested.  If the results are unsatisfactory, the script line can be restored.  If we wanted to try the macro using the script line If Window Title "Charge" is running instead of the command If Window Title "Charge" is on top, we would click on the macro script line If Window Title "Charge" is running to select it, and then click on the Disable Command icon in the left margin:

We also need to enable the script line If Window Title "Charge" is running by selecting the line.  The red circle around the exclamation point on the icon will disappear and the exclamation icon now represents the Enable Command.  We then click on the Enable icon.  The red line-out through the script line If Window Title "Charge" is running disappears.  We can now save the macro and test the edited version.  Apparently the script If Window Title "Charge" is on top worked best; the other option was disabled but never deleted from the macro.

Deriving a New Change Template Macro from a Pre-existing Change Template Macro

1. Typically, your unit will probably have a template it is already using & you want to apply a change template macro to enhance productivity. Or if necessary, create the new template. Instructions may be found at Creating Templates in Voyager.

Be sure to save the template to:

c:\voyager\catalog\template\preliminary record templates

For demo purposes, we'll call the new/pre-existing template:

newtemplate.tem

2. Open Macro Explorer, select the Acquisitions folder from Categories, and right click any one of the Change Template macros. We'll use the Change Template: Serials macro for demo purposes. The options menu will open. Click on the Copy Macro option.

3. The Copy Macro dialog box will open. Leave the default No Activation as is and click OK.

4. The macro copy, named "Copy of <name of original macro>" will appear on the Nickname list immediately, under Copy of <name of original macro>.

5. Double click on the line item for the macro copy to open up the Scripting Editior window.

6. From the Macro Script subwindow, double click on the line

A TEXT TYPE:c:\voyager\catalog\template\preliminary record templates\preliminary serial.tem

7. The Text Type window will open.

8. In the Keystrokes area, change the last element of the text string from preliminary serial.tem to newtemplate.tem and click the OK button at the bottom of the window.

9. Click on the Scripting Editor's Properties Tab. Change the Nickname to: Change Template: New Template.

Note that the Scope Tab does not need to be clicked. The Scope for the original macro (Voyager Cataloging Module) is carried over when the macro is copied.

10. Save the changes made to the macro. Click on the Macro Explorer icon, then click Yes to save the changes. (Or click on the Floppy icon on the Toolbar; or File-->Save)

11. Having created the new change template macro, you now need to add it to the PopupAcq menu. Double-click on the PopUpAcq line (in the same Acquisitions folder on Macro Explorer; see the Macro Express Tip 3). The PopUp Editor window will usually display. (If another PopUp Menu Builder window opens, click on the Editor tab):

12. You want to get the new macro from the Available Macros window into the Macros in Menu window. First, use the the scrollbar for the Available Macros window to find the new macro Change Template: New Template. Click once on the line to select the macro. This will activate the Insert/Add arrows. Assuming you want to insert the new macro in alphabetical order, use the mouse to selectChange Template:Serial and click on the Insert (Above) arrow, i.e. the leftmost arrow. This should insert the macro before Change Template:Serial. If you change your mind, you can use the Up and Down arrows on the right of the Macros in Menu window (see image above) to re-locate the macro in the menu.

13. Save the new menu configuration. The next time F12 is pressed, the new macro will be listed in the order you specified.

14. Troubleshooting: the change template macros only work if the templates are in the proper folder and the folder path for the templates has been set in Voyager Sessions and Defaults to

c:\voyager\catalog\Template\preliminary record templates\

Make sure the workstation setting follows our local standard path.

Importing Macros

Important: macros can be attached in e-mail only as files; even if a single macro is sent, it must be first exported into a file. 

1. Having received the file RDAFields.mex, save it to the Macro Express folder.

2. (The assumption is your current file is MASTER5D.mex, the MacEx file that contains both the Voyager diacritics macros and the Voyager functionality macros.) Open the Macro Explorer window. Under Categories (the 2nd window from the left, select the Edit category. The macros for the Edit category should appear to the right.

3. With the target category Edit selected, click on the Import Macros icon on the toolbar.

4. The Import Macros window will open.

5. Click on the Open File tab. The Import Macro File window will open. Make sure "Look in" is aimed at Macro Express 3 (since that is where you moved the RDAFields.mex file).

Screen Shot of &quot;Look in&quot; window

6. When the "Look in" window is open, double-click on RDAFields.mex (or select & click the OPEN tab). The Import Macros window will now list all macros in the file RDAFields.mex. (In this case, just one.)

Import Window RDA

7. Click the Select All tab. The macro will be highlighted and the Import tab will be enabled.

8. Click on the Import tab. The macro will be copied into the Edit folder. Then click Exit.

Note: Sometimes when importing, you may get a message that one of the macros was using an activation key already claimed by a macro in your current file. Click Yes.

In that case, the newly imported macro will be imported as Inactivated. (It will not overlay the macro using that key activation.) You will need to either reassign the key activation on your current macro and then reactivate the import macro to its default activation key, or assign a new, non-conflicting activation key to the imported macro. (Check with your expert user.)

MACRO: Frontlog 2006-02 (draft)

NOTE: The macro was created by Jared Schwede (student working for SML Acquisitions) in 2004 and rev. and re-named by Eric Friede in 2006 to account for changes in Voyager 5.0.

BACKGROUND. When cataloging copy is not available at the time of receipt, SML Acquisitions staff route items without copy to the Frontlog, a caged area in the SML basement containing some 100,000+ items. For status tracking purposes, the physical item is associated on Orbis with an item record, and the item record is associated with a 14 digit barcode number, e.g. 39002059419508.The barcode itself is affixed to the book (or other physical item equivalent) and charged to a dummy Orbis patron, e.g. frontlg245.

Although there is a maximum number of potential charges to a frontlog patron, that number is large enough to warrant further subarrangement to facilitate retrieval due to patron requests. The subarrangement is based on an additional 6 digit barcode number printed on a slip kept with the book. The "Frontlog number" always begins with UNCAT followed by 6 digits, e.g. UNCAT225565. This number is used to shelve the book in the FRONTLOG area in the SML basement. In order for Circulation staff to find the book for a patron request, the number is entered in the Orbis MFHD record field 852 $h. This requires SML Acquisitions staff to change the MFHD 852 $h from this:

852

8 0

‡b sml ‡h In Process

to this:

852

8 0

‡b sml ‡h UNCAT225565

OPERATION (General). The user sets up by opening the Cataloging and Circulation modules. From the Circulation module, the user opens the Charge window and enters the dummy patron name. If any windows are open in the Cataloging module, the macro is started from Cataloging to ensure that all Cataloging module windows are closed. (??)The user then turns on the macro, usually mapped to CTRL+f.

  • The macro first prompts the user for the barcode number with a dialog box.
  • When the barcode number is entered, the macro charges the item to the Frontlog status (the macro will override any intervening Circulation windows to do this).
  • The macro then switches Orbis from the Circulation module to the Cataloging module,
  • retrieves the item record via the item barcode number,
  • opens the associated MFHD record,
  • selects the In Process text in 852 $h, and
  • opens a dialog box prompting the user for the frontlog barcode number.
  • When the user wands the barcode number from the slip, the selected In Process text is replaced by the barcode number.
  • The macro then switches Orbis from the Cataloging Module back to the Circulation and
  • opens the dialog box prompting the user for the next item barcode number.

MACRO SCRIPT COMMENTS

1. Macro Playback speed: Normal. Because this is a complicated macro, the Macro Playback speed is included to allow the option of a slower playback if the macro needs to be tweaked.

To set Playback Speed:

  • Select Timing from the Commands window,
  • Double-click on Macro Speed to open the Speed dialog box,
  • Click on the Macro Speed button,
  • Enter Playback Factor 1 for normal playback speed.
  • The macro script line should read: Macro Playback Speed: Normal Speed

2. If condition. The macro is intended to work with no record windows open in the Cataloging module, so this series of commands is intended to ensure that all record windows in the Cataloging module are closed. This is especially important since the macro needs to open some Cataloging windows later in the sequence, and these windows need to be closed before the macro can repeat. (??) If no Cataloging module windows are open, the macro will ignore this sequence (2.) and go on to 3 (but you don't need to specify this in the macro script).

  • Select Logic from the Commands window,
  • Double-click on the If Window option to open the If Window dialog box,
  • From the Commands list in the If Window dialog box, click on the radio button If Window on Top
  • In the same If Window dialog box, find below the Commands options list the Window Title: prompt slot, and enter the text: Voyager Cataloging - [
  • Leave the Partial Match radio button selected
  • Click OK button
  • The macro script line should read: If Window Title "Voyager Cataloging - [" is on top

Comment: The window title Voyager Cataloging - [ ensures that the series of commands operates only if the Voyager Cataloging window is open. The Partial Match option means that the commands will work even if a specific record number and title are displaying after the initial Voyager Cataloging - [ on the title bar of the Cataloging Module window, e.g. Voyager Cataloging - [Bib 6018213 : Sobre o vale do mosteiro / Eugenio Mendes Pinto.]

  • Select Text from the Commands window,
  • Double-click on the Text Type option to open the Text Type window
  • Below the blank Keystrokes space, several columns of function/command keys are listed. Select (single-click) Control in this list, which will cause the text <CONTROL> to appear In the Keystrokes space.
  • Type the letter q after <CONTROL>; the keystroke sequence is now: <CONTROL>q
  • Click the OK button
  • The macro script line should read: Text type: <ctrl>q

Comment: In Voyager, the key sequence <ctrl>q saves the record. The following macro command sequence accounts for the dialog box that follows a save (<ctrl>q) command in Voyager, requiring the user to press ENTER to complete the save, followed immediately by the command sequence to close all open windows.

  • Select Timing in the Commands window,
  • Double-click on Wait Window Lose Focus to open the Timing Commands dialog box, where that option will have been selected,
  • In the Window Title prompt slot, enter Voyager Cataloging - [ (or use the browser [ellipses] button to find & select the title),
  • Click on the Wait a Maximum of: radio button (the current macro uses 10 minutes), and,
  • Click OK
  • The macro script line should read: Wait Window Lose Focus: "Voyager Cataloging - ["
  • Select Text from the Commands window,
  • Double-click on Text Type option to open the Text Type window
  • From the command keys list under the blank Keystrokes space, click on Enter to select the <ENTER> key, then click on Alt to select the <ALT> key, then
  • Type fo; the line should now read: <ENTER><ALT>fo
  • Click OK
  • The macro script line should read: Text Type: <ENTER><ALT>fo

Comment: <ALT>f opens the Voyager File menuo selects the Close All command from the menu. The "if" situation where all Cataloging module windows need to be closed is now completed. However, Macro Express requires you to indicate that the "if" sequence is over, so:

  • Select Logic from the Commands window,
  • Double-click on the End If option (End If will appear as the last line of the macro script If sequence)

3. Now that all the windows in the Cataloging module are closed, the macro needs to activate the Circulation module window. Before this is done, the Circulation window is maximized.

  • Select Windows/Programs from the Commands window.
  • Double-click on Windows Maximize to open the Windows Commands dialog box; the Maximize Windows radio button should be pre-selected under the Commands options.
  • Under the Window options, click on the Specific Window radio button to select that option and typeVoyager Circulation in the option slot
  • The macro script line should read: Window Maximize: "Voyager Circulation"

Comment: Maximizing the Circulation window may no longer be necessary. The original version of this macro depended on mouse positioning, which worked more effectively with the Circulation module window maximized. Macros based on mouse positions are high-maintenance, since the positions need to be recalculated for different workstations or after software upgrades. The current version is based on key sequences (keyboard shortcuts). Key sequences don't change from workstation to workstation, and usually the only problem is if a key sequence or the screen layout changes after a software upgrade (as has been the case at times with Voyager 5.0).

4. Now the Circulation window must be activated, since you want to perform a function (charging the item barcode) in the Circulation module:

  • Select Windows/Programs from the Commands window.
  • Double-click on Window Activate to open an abbreviated version of the Activate/Launch Programdialog box. The Activate Window radio button should be pre-selected under the Activate/Launch Program Commands.
  • In the Activate Window option slot, type Voyager Circulation, then click OK.
  • The macro script should read: Activate Window: "Voyager Circulation"

5. At this point, we want the macro to open a dialog box to prompt the user to wand in the item barcode number. The prompt dialog box will look like this:

As an insurance measure, just to make sure that another variable has not been stored in the memory, a line of code is entered to clear variables before the prompt dialog box is evoked.

  • Select Variables from the Commands window.
  • Double-click on Clear Variables; the defaults should be Variable Type to Clear: Text Variables with radio button Clear All selected.
  • Click OK; the macro script line should read Clear Text Variables: All

To create the prompt dialog box:

  • Select Variables from the Commands window.
  • Double-click on the Variable Set String option to open the Set Text String Variables dialog box.
  • Under Commands in this dialog box, click on the radio button Prompt for Value.
  • Variable Name T1 is the default, which is OK since this will be the first text variable in this macro.
  • The Prompt Text field will open within the Set Text String dialog box. Type in: Please enter item barcode
  • The center/center default positioning of the prompt box is OK to leave as is.
  • Click OK; the macro script should read: Variable Set String %T1% from Prompt

6. The expected response to Please enter item barcode is for the user to wand the item barcode (i.e., the T1 variable text string). A delay of 100 milliseconds is added to the script to provide sufficient time for the macro to tell the computer to read and record in memory the wanded item barcode number and close the Please enter item barcode prompt window. With the Circulation module Charge Window now on top, the macro is then instructed to type the T1 variable (the item barcode number it has just read); the only space available for the number to be typed is the BARCODE slot.

7. With the item barcode number now typed into the BARCODE slot, the macro can now ENTER the number (text) string. A delay of 100 milliseconds is added to give Orbis time to bring up the Item Blocks and Information Window, an unfortunate extra step built into the Voyager technical services charging procedure whenever a new item barcode number is entered in a Tech. Services charge. The macro runs the key sequence <ALT>o to override the window. Depending on the workstation, another Item Blocks window may open, so another If condition sequence is added. The item is now charged to the Frontlog dummy patron.

8. The Circulation window is now minimized and the Cataloging module window is activated. In the Cataloging module, the Retrieve an Item Record (<ALT>rb) prompt window is opened. A delay of 100 milliseconds is entered to give the window time to open. The item barcode number (T1 variable) is typed in by the macro, with another 100 millisecond delay for the number to be read by Voyager. The Text Type <ENTER> (the equivalent of pressing the ENTER key) tells Voyager to retrieve the item record. Another delay is added to the script to give Orbis time to retrieve the item record. <maybe not necessary, since it's followed by the Wait for Window>

9. The Wait for Window Title accounts for different response times. A key sequence <ALT>rg is used to open the MFHD associated with the item record retrieved at 8. Another delay is written in (again the Wait for Window ought to take care of variations in response time). The clear variable command must be re-executed to clear out the T1 variable (the item barcode) so it can be replaced by the T2 variable, the frontlog barcode, or, alternatively, letters to initiate one of two If conditional sequences.

10. The prompt for the T2 variable is created. The T2 can be either the frontlog barcode number or a letter to initiate one of two sub-macros for lnb and art. If the location is sml, the frontlog barcode is wanded and the process continues.

11. If the letter "l" or "a" is entered, different sub-macros are run. This requires 2 If condition sequences to cover backlog locations lnb and art, initiated by a prompted letter "l" or letter "a" requested by the prompt. If a sub-macro is run, it loops back to the original prompt at which point the user is prompted to wand in the frontlog barcode only.

12. With the frontlog barcode=T2 based on 10. or 11., another sub-macro is inserted into the script, GOTO 852 in MFHD. The function of this macro is to align the cursor with the selection bar for the 852 field in the MFHD.

13. From the selection bar, a key sequence of TABS and <CTRLD><ARROW LEFT/RIGHTs> are used to select the In Process text in 852 $h, which is then copied to the clipboard and replaced with the T2 variable text, i.e. the frontlog barcode number. <BUT WHERE IS IT PASTED INTO THE MFHD???>

14. To account for situations where there is no In Process text or the macro did not successfully copy the text into the clipboard, an If conditional is added to halt the macro under any condition where the text is not In Process.

15. The macro is nested to allow indefinite repetition.

Staff Search Macros Component: Editing the Get Control Function

All of the Staff Search macros use 2 nested macros that may need to be adjusted when the Voyager software is upgraded. Attempting to use the macro (e.g. Alt-Shift-Y to change the Staff Search index to Staff Search Names), will abort the macro run and bring up the following window:

Get Control Abort

Because the macros are nested, the Search macros point to two separately configured macros, Capture Search By and Go to Search Box instead of including all of the steps in each Search macro. As a result, if something happens to these two macros, none of the Search macros will function. Conversely, if the two macros are properly configured, all of the Search macros should work.

Screen Shot of the Capture Search By Macro Script. Note the "Get Control" lines of the script. These are telling the program where to look before performing the instructions in any of the Search scripts (i.e. to dial up the appropriate search index). Behind the GUI, the Voyager programmers have identified different regions of the windows by various codes. ThunderRT6ComboBox corresponds to the index selection area in the Search window. The only way to identify the underlying code for the window area is to reassign the Get Control instruction.

Capture Search Script

Preparation. Voyager needs to be running with the Search window open. The Voyager window should not be full screen; you need to see both the small Macro Express utility windows and the Voyager window on your monitor.

1. From the Macro Express script for Capture Search By macro, double click on the first Get Control instruction line. The Get Control window will open. Note carefully the Control Class text--the area in the Search window corresponding to this coding is what you are looking for. Click on the Launch Get Control Utility button.

Get Control Window

2. The Capture Window Control window will open. Note the Cross Hair symbol at the bottom of the window.

Capture Window Control

3. Make sure the Capture Window Control window and the Voyager window are both visible on the monitor and that the Search window is open in Voyager. If necessary, drag the Capture Window Control window to a corner of the monitor display so it can be accessed while the Voyager Search window can be seen.

4. Drag the cross hair icon to the search window (point and hold down the default left mouse button). The process will open a black lined rectangle. Use the mouse drag to make sure the rectangle overlays the select index slot. If the rectangle is correctly positioned, the Window Text in the Capture Control Window will be: ThunderRTComboBox. When that text displays, click the Save button.

Selecting Index Area in Search Window

5. Repeat the process for the other Get Control lines in the script. The Variable Get Control Text line should not be changed.

6. Save the updated script.

Next, update the Go to Search For Box macro. This macro script is simpler:

Go to Search for Box Script

Follow the instructions for the Capture Search By macro, but select the Search for area of the Voyager Search window. Be sure that the cross hair is correctly aligned--the required area is very close to different areas. In the Capture Window Control, the Class Name text must be: VSFlexGridN. Note that you are changing C2 rather than C1. Only the Get Control line should be updated; be sure to save the updates. Since the macros are nested in the Search macros, updating the Capture Search By and Go to Search Box macros will allow all of the Search macros to function.

Capture C2

PS: Re-selecting and re-saving the class names is apparently required because the values in the hierarchy (click on the Display Control Info button on the Get Control Window) changed with 7.0.2. Re-selecting and re-saving re-synchs the macros.

Control Details