Copying a sequence of commands to a macro

A macro for use by an application program is described. The macro is embedded in a macro file including at least two versions of executable configuration code corresponding to two different operating systems to interface the macro file to an application program. Attached to the macro file is a sequence of actions to apply to an application file produced by the application program. Also attached is application identification information that identifies an original host application corresponding to the macro. The sequence of actions in the macro file can be produced by storing commands, applied to a data file opened in the application program, into a log file and transferring at least one stored command from the log file to the macro file.

BACKGROUND

This invention relates to computer application macros.

Most computer applications have macro generators for producing macros for user-definable lists of actions or commands to apply to a data file associated with the application program. Often a user makes changes to a data file and then desires to repeat those changes on subsequent data files. One approach to repeating changes made to a data file is to have the user remember the changes and use the macro generator to produce a macro file with the actions to be applied to the data file.

SUMMARY

According to one aspect of the invention, a method of producing a macro file for use in an application program includes storing commands, applied to a data file opened in the application program, into a log file and transferring at least one stored command from the log file to a macro file.

The transferring can copy or move the action. The log file can be represented as a history palette that stores commands. The history palette can have associated with each command is a command icon that can be dragged from the palette. When the commands are transferred, they can be transferred to an action palette that builds the macro file. The actions can be transfered by dragging icons representing the commands to the action palette.

According to another aspect of the invention, a computer program product residing on a computer readable medium for use in an application program including instructions for causing a computer to store commands applied to a data file opening in the application program, into a log file and transfer at least one stored command from the log file to a macro file.

One or more advantages are provided from the above embodiments of the inventio. For example, a user can apply a sequence of commands to a data file. Thereafter, the user may decide to make those commands into a macro. The user can retrieve all or selected ones of the actions and place them into a macro generator such as an action palette and produce a macro file. The commands can be saved with the information needed to produce a macro. Therefore, rather, than exclusively using a conventional macro generator, the user can select commands from a log file i.e., history palette by dragging the selected actions to the macro file in the action palette or other macro generator. There is no need for the user to try and recreate the commands applied to a data file since the commands are stored in the history palette or log file in such a manner that they can later be applied by the user to a macro.

DETAILED DESCRIPTION

Referring now toFIG. 1, a networked computer system10includes a first computer system11including a processor12, a main memory14, display18, storage adapter20and network adapter24coupled via a computer system bus16. The storage adapter23couples a storage device22such as a hard disk drive to the system bus16.

The first computer system11is coupled to a second remote computer system31via a link such as network adapters24and34and network28. Remote computer system31(e.g., a server for system11) includes a processor32, main memory34, and storage adapter35coupled via a computer system bus36. The storage adapter35couples a disk drive37to the system bus36.

Computer system11can operate under a first operating system such as a windows-type operating system (e.g. Windows 3.1® Windows95®, Windows NT® (Microsoft Corporation, Redmond, Wash.); whereas, computer system31can operate under a different windows-type operating system, e.g., Windows95® or a different operating system such as the Macintosh® (Apple Computer, Inc.) operating system or an operating system such as Unix® (The Open Group).

Residing on disk drive22is a desktop folder22a. The desktop folder22aincludes a macro file19associated with an application program22b. The desktop folder22acan include a plurality of files that in conjunction with a computer operating system (not shown) renders a plurality of icons on the computer display18such as icon19′. Such icons can be selected by a user to execute application programs (e.g., application program22b) on the computer system11. The application program22balso includes one or a plurality of data files21that were produced with the application program22b. A data file21is typically a file generated by a user executing an application program and is any file that the application program22bcan understand. The computer disk drive22has a second copy of the macro file19stored in a second folder22c. Folder22cis a general folder in the file system of the operating system (not shown). A folder is a user interface that often corresponds to a directory structure element in the file system. Residing on the disk drive37in remote system31is a third instance of the macro19.

As illustrated, a rendition of a desktop18′ is provided on display18during operation of the computer system11. The desktop rendition18′ includes a plurality of icons (only one of which is shown) that correspond to application programs which can be executed by a user. One of these icons is a macro icon19′ that corresponds to one of the instantiations of the macro file19. Three instantiations of macro19are illustrated to show that the macro file19can be stored in various locations (e.g., within a local folder22cof the computer system11, within the desktop folder22aof the computer system11, or remotely stored in a folder37a. Only one of those instantiations would be associated with icon19′.

The user produces a sequence of actions within an application program and stores the sequence of actions as an executable macro file19. The icon19′ corresponding to the executable macro file19is placed on the desktop18′. The macro file19includes an executable macro (e.g., the packaged list of actions) and sufficient executable information to invoke the original application so that when activated, the macro file19is executed in the invoked application program and extracts the list of actions and applies the macro, i.e., list of actions to the data file21.

The icon19takes advantage of the so-called drag and drop feature common in window-type operating systems. Therefore, the user can drag any number of data files21to the macro icon19′ and the macro file19includes a sequence of operations to call a host application that can apply the actions in the macro to each of the data files21.

Referring now toFIG. 2, a process40in the application program22bfor producing macro file19includes producing42a macro list of actions in which a user selects the series of actions to apply to a data file. The user can select the action from a list of known actions to produce the macro file19. The list of actions can be presented in a palette, for example, or other type of macro generator depending on the application program22b. The user can transfer44this macro file (or a pointer to the macro file, e.g., a Windows95 shortcut) to a destination that is outside of the memory address space of the application.

Referring now toFIG. 3, the process42for producing the macro file19includes producing50the list of actions within the application. Within the application program, the list of actions are packaged52into an executable file. Executable configuration information is also added54to the macro file19. The application configuration information includes application code that enables the macro file19to invoke or call the original application program that produced the macro. Thus, for example, this type of application configuration information would typically include code such as OLE® (Object Linking and Embedding Microsoft Corp.) type code for Windows® based applications or DDE® (Dynamic Data Exchange, Microsoft Corp.) Apple Events®, for Macintosh operating systems (Apple Computer, Inc.) or CORBA (common object request broker architecture) for Unix® operating systems.

In one embodiment, the process50inserts54configuration code for each operating system environment that the macro can run under. Thus, for example, the macro file19can include configuration information for Windows95® operating system and a separate set for another operating system such as Macintosh® or Unix®. Typical combinations include Windows® and Macintosh, and Unix and Macintosh.

Referring now toFIG. 4, the process44for executing the macro includes transferring46data files21onto the macro file19. The action of transferring an application file21invokes48the host application to execute the macro file and apply the actions to the application file21. Transferring46application files onto the macro file19could involve a process such as dragging icons (not shown) representing the files21, and dropping the icons onto the folder containing the macro file19or dropping the icons representing the files21directly onto the macro file19. Alternatively, if the macro file19is represented as the icon19′ on the desktop18′, the icons representing the application files can be dropped onto the icon19′.

Referring now toFIG. 5, the process for transferring the application files46includes preparing the application files by providing a string that identifies the file locations and prepares the list of actions. The file locations and list of actions are transferred to the host application in the host application call64. The icon19′ has associated with it sufficient information to identify the location of the underlying executable file19. The underlying executable file19has sufficient information provided by insertion of the executable call to identify the name and location of the host application program associated with the macro file19. Therefore, the application program can be remotely stored in a different computing environment than that of computer system11.

Referring now toFIG. 6, the host application executes48the macro by retrieving66the files, applies68the actions obtained from the list of actions to the retrieve files and can store70the retrieved files that result from performing the actions.

Referring now toFIG. 7, a process80for editing the macro file19includes activating82the icon19′ to call the host application and open84the macro file19in a macro editor in the host application. Activating the macro editor produces the list of actions included in the macro file19. The list of actions can be rendered on display18. The list is edited88, and the edited list is re-packaged90and is stored92.

FIGS. 8A and 8Bshow a pair of sequences of operations to invoke an application program across a heterogeneous environment. The macro file19that is produced can run in any of a plurality of operating systems. Consider, for example, that the macro file19includes both Windows95 and Macintosh code.

Referring in particular toFIG. 8A, application file21is shown dropped on macro19. The application file21is dropped from a Macintosh environment to a Windows environment. Macro file19includes Macintosh and Windows executable files. In a Macintosh environment, the file contains 680X0 configuration code in the resource fork and X86 configuration code in the data fork.

Data fork and resource fork are file structure conventions in the Macintosh operating system. When the file is moved from the Macintosh to Windows95 environment, the resource fork data is lost. The X86 configuration code remains in the data fork, however. To execute the file, the file is renamed at102.

Typically, the file is renamed by the user to insure that it has an “*.exe” extension. This extension is the extension that a Windows executable would typically require. The application program finds104the code that invokes the application in the data fork and executes106the macro file19.

Referring toFIG. 8B, file21can also be dropped from a Windows environment onto a macro file19which is in a Macintosh operating system environment. In the Windows environment, the file only contains the X86 configuration code in the data fork. To move to the Macintosh environment, the process executes110the host application and opens112the macro in the host application. The host application will detect that the resource fork data is missing and regenerate the Macintosh configuration code and store the code in the resource fork. Thereafter, the host application will store116the code and execute118the macro.

Referring now toFIG. 9, the data structure20representing macro file19includes executable configuration code file20awhich stores the OLE or other remote application executable code. Dragging files onto the macro file19or icon19′ executes the configuration code in file19aas an operating system process. This code sets up the files21and invokes the host application. The data structure20also includes an optional check value field20b. The check value field20bcan be used to test the integrity of the data structure20. The check value field20bis populated with a value that is checked prior to execution. The data structure20includes a third field20ccorresponding to the executable name of the host application. The data structure20also includes a script field20dwhich, when executed, recreates the macro list of operations. One preferred way of implementing the script field20dis to use a Java® (Sun Microsystems) script program to recreate the list of operations. The data structure20also includes an application creator code field20ethat is used for Macintosh type applications (i.e., storing Apple Events® code) and is the second operating system equivalent to the executable file field20a. The data structure20may include a second, on time check value field20fagain having a value that is checked prior to execution. The data structure20includes a pointer20gwhich points to the end of the executable file20a. This identifies to the data structure20where the data structure20actually starts.

Referring now toFIG. 10, the computer desktop18′ has a dialog box130opened. The dialog box130includes a plurality of tabs132a-132chaving different functions such as “optimze”, “info” and “move options”. In particular, the dialog box130includes an icon134that is associated with the macro file19opened in the application program22a. The icon134can be dragged from the dialog box130and placed on the computer desktop18′. As a result of dragging the icon134, the macro file19is automatically stored in the desktop folder22aand automatically assigned a name.

Referring now toFIG. 11, the computer desktop18′ is shown as having the dragged icon18″ (provided from dragging icon134) and three data files142a-142c. The three data files can be dragged to the icon18″ causing the actions in the macro file19associated with the icon18″ to be applied to the data files142a-142c.

Alternatively, the macro file19can be moved to the computer desktop or elsewhere in the computer system11by pushing the “create” button136. The create button136can have a second dialog box (not shown) appear having locations for a file name for the icon and a storage location for the icon.

Referring now toFIG. 12, a computer system210includes a processor212, a main memory214, display218, and storage adapter220all coupled together via a computer system bus216. The storage adapter220couples a storage device230such as a hard disk drive to the system bus216. Computer system210operates under an operating system and includes an application program232shown on disk drive230having associated therewith a macro file19.

The application program230includes a log file such as a history palette236that records commands that were executed by a user in modifying the state of a data file238associated with the application program22a. This history palette236, therefore, has a list of all commands generally in the sequence issued by the user that when executed or reversed will modify the state of the data file238. The application can also include a macro generator such as an action palette239that contains a list of macros that can be applied to a data file. The action palette can be used to record macros and save them in a macro file for later use in the application.

Referring toFIG. 13, a window250is shown in various stages of use. The window250has a tool palette252, user work space254, history palette256to store and display actions or commands applied to a data file (not shown), as defined by the user in the work space254, and an action palette used to produce macros. The history palette256displays the commands256a-256cthat were applied to the user work space254. The action palette has a button258afor initiating a macro record mode.

Referring toFIG. 14, the window250has a dialog box260displayed with a record button262. Dialog box260is a new action (macro) box enabling a user to record a macro and name the macro. It is invoked by a user pressing the button258a(FIG.13).

Referring now toFIG. 15, the window depicts a stop button258bon the action palette258. The assertion of the stop button immediately after the assertion of the record button262causes an empty macro file to be generated. Of course, the macro file can be generated to have some commands and additional commands can be added as will be described below.

Referring now toFIG. 16, the window250has the action palette populated with a new action264including new commands264aand264bprovided by dragging icons256b′ and256c′ (corresponding to commands256band256c) from the history palette256. Icon256a′ is not dragged since a user does not wish to apply the corresponding command256ato the macro. In the action palette258, arrows266are shown in an open, i.e., down position, so that the details of the commands can be depicted.

Referring now toFIG. 17, a process270for storing commands applied to a data file is shown. A user applies272commands to a data file that is opened in the application program230. These actions are stored274in a log such as the history palette256(FIG. 13) which displays a list of the commands applied by the user. Macro information that would be needed to place these commands into a macro file is also stored276.

Referring now toFIG. 18, a process280to create a macro file is shown. This process can be used separately or in conjunction with the process described in conjunction withFIGS. 1-11above. The user can produce an empty macro file. This can be accomplished by launching the action palette (i.e., pressing button258a(FIG. 13) and pressing record252(FIG. 14) and stop258b(FIG.16). Commands are placed284from the history palette258(FIG. 13) into the empty macro file. These commands can be placed by dragging icons256a′-256c′ (FIG. 17) from the history palette into the action palette or another file associated with a different type of macro generator. The process can be configured to have the action of dragging icons256a′-256c′ either move or copy the icons and hence the underlying commands from the history palette to the action palette. The process280retrieves286, and adds287, the macro data (such as macro data structure20FIG. 9, for example) associated with the command that was placed in the empty macro file. The macro file is packaged and saved288.

Accordingly, a user can apply a sequence of commands to a data file and thereafter decide to make those commands into a macro by retrieving all or selected ones of the actions and placing them into the action palette producing macro file. Rather, than exclusively using a conventional macro generator, a user can select commands from the history palette by dragging selected actions to the macro file in the action palette or other macro generator. There is no need for the user to try and recreate the commands applied to a data file since the commands are stored in the history palette or log in such a manner that they can later be applied by the user to a macro. As above, the macro file can be represented by a macro icon19′ and icons corresponding to data files can be dragged onto the icon19′ enabling the icon19′ to execute the macro operations defined therein and apply those actions to each one of the files as a batch operation.