Zeus Forum Index Zeus
Use this forum to ask for help, submit a bug report or make a suggestion.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Writing Zeus Macros Using Digital Mars Scripting

 
Post new topic   Reply to topic    Zeus Forum Index -> Tutorials, Tips and Tricks
View previous topic :: View next topic  
Author Message
jussij
Site Admin


Joined: 13 Aug 2004
Posts: 1938

PostPosted: Thu Sep 22, 2005 5:51 am    Post subject: Writing Zeus Macros Using Digital Mars Scripting Reply with quote

Since the Digital Mars Scripting implements the Windows Scripting Host interface, this means it is also possible to write Zeus macros using the DMD Scripting language.

To setup Zeus for DMDScript scripting do the following:
  1. Make sure you are running the latest version of Zeus

  2. Download the DMDScript component

  3. Register the DMDScript WSH using regsvr32 dscript.dll

  4. Go to the Zeus install directory and edit the scriptwsh.dat file making these changes:
    Code:
    [Options]
    Language=DMDScript
    Extension=ds
    MacroBegin=function key_macro()\n{
    MacroEnd=}\n\nkey_macro()   // run the macro
    FunctionPrint=\tzeus.write("%s")
    FunctionPrefix=zeus.
    FunctionPostfix=;
    Enter=\n
    CRLF=\\n
    LineFeed=\r
    Tick='
    Quote=""

  5. Close, then restart Zeus

  6. Save this test macro to the zScript\test.ds location
    Code:
    function key_macro()
    {
        zeus.screen_update_disable();
        zeus.FileNew();
        zeus.write("ScriptEngine: " + ScriptEngine() + "\n" +
                   "Build: " + ScriptEngineBuildVersion() + "\n\n");
        zeus.write("This is a Digital Mars macro script........\n")
        zeus.screen_update_enable();
        zeus.screen_update();
    }

    key_macro()   // run the macro

  7. To run the test macro use Macros, Execute Script menu and type in test.ds
If all goes to plan the macro will create a new document window and the line of text will be added to the document.

Cheers Jussi
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Zeus Forum Index -> Tutorials, Tips and Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group