Quote:...I read somewhere that you could do that by calling a macro with a startup switch something like this "c:\sesame\programs\sesame.exe - @macro("mainmenu")...
Here's an example of an actual shortcut's target field that I use:
C:\Sesame\Program\sesame.exe "Data\Price List.db" -macro "Data\Price List Menu.mac"
Note that the macro filename also contains the name of the application file. I did it this way because I have more than one application that uses a custom menu. (I don't close the Sesame command tree, but you could also include a startup switch to do that, if needed.)
The most helpful command button I created, is the one that automates the "Backup Application" function. One click and its done - no browsing through a list of filenames to find the correct backup file for the app I'm working with, and no popup warning message asking me to confirm - it just gets the job done.
Here is the programming for the "Backup" command button:
var success as Int
var MacroFile as string
success = @SelectTreeItem("Price List!Application Utilities!Backup Application")
if success = 1 then
{
MacroFile = @repllas(@fn, "\", "\Backup ") // Insert "Backup "
MacroFile = @repllas(MacroFile, ".db", "") // Delete ".db"
@macro(MacroFile + ".mac")
}
I could have hardcoded the macro filename, but with this code, I can simply copy & paste it into other apps, without modification.
This code looks for a macro file in this format (assuming you are using the Sesame default directory structure):
C:\Sesame\Data\Backup [AppFileName].mac
Example:
C:\Sesame\Data\Backup Price List.mac
The macro is needed because the @SelectTreeItem function only opens the file selection window where you select or type a filename for the backup copy. The macro I recorded simply contains a mouse-click in the
Filename text box (be sure to click so the cursor is at the end of the default "Data\" subdirectory), and then contains the keystrokes to type out the name of the backup copy, then mouse-clicks on
Accept.
I don't think it's safe to just click on the filename in the list rather than typing it out. The list of files can (and is likely to) change, and I'm not sure whether Sesame records the name you click on, or if it just records where you clicked - better to be safe than sorry.