Using the Console2 Inside of Zeus

This forum allows you to share scripts with other Zeus users. Please do not post bug reports, feature requests or questions to this forum, but rather use it exclusively for posting scripts or for the discussion of scripts that have been posted.
Post Reply
Site Admin
Posts: 2461
Joined: Fri Aug 13, 2004 5:10 pm

Using the Console2 Inside of Zeus

Post by jussij » Fri Nov 30, 2012 3:57 am

A simple macro to run the Console2 utility from inside of Zeus.

Code: Select all

#        Name: Console2 Lua Script
#      Author: Jussi Jumppanen
#    Language: Python Macro
# Description: This Lua script creates a new Console2 console window from
#              within the Zeus IDE. It will create the console in the same
#              drive and directory of the active file. It will also maintain
#              the current working directory.
import os
import zeus
import subprocess

def key_macro():

   # the installation folder for the Console.exe utility
   cmd = ["C:\\Workspace\\Zeus\\Console2\\Console.exe"]

   # add a caption to the window
   cmd.extend(["-w", "DOS Prompt"])

   # set the current working directory
   cwd = os.getcwd()
   cmd.extend(["-d", cwd])

   # the ditrectory of the active file
   directory = zeus.macro_tag("$FDD")

   if len(directory) > 0:
       # change to the directory of the active file

       # add in the directory options
       cmd.extend(["-d", directory])

       # the drive letter excluding the '\' character
       drive = zeus.macro_tag("$FDR")

       # change to the correct drive
       cmd.extend(["-r", "cmd.exe /k " + drive])

   # run the console executable

key_macro() # run the macro

Post Reply
kuchnie warszawa opinie

Who is online

Users browsing this forum: No registered users and 4 guests