Currently viewing: GipsySoft » Front Page» Articles

Some handy macros

Not a lot to be said really. Just paste them into a DSM file or add them to your own macros - add a toolbar or keyboard mapping if you wish.

I have only tested this under WinXP and Win2K.

Open Explorer in the current project

Often there is the need to browse the project directory. Simply assign a key (I use CTRL+E) or add a toolbar button and instantly open Explorer in the project directory.

Sub ExploreProjectDirectory()
	strPath = Application.ActiveProject.FullName

	pos = InStrRev( strPath, "/" )
	strPath = left(strPath, pos )

	Set Sh = CreateObject("Shell.Application")
	sh.Explore strPath
end sub

Open console in the current project

Same deal as the ExploreProjectDirectory macro except this one opens a console window.

Sub OpenConsoleInProjectDirectory()
	strPath = Application.ActiveProject.FullName

	nPos = InStrRev( strPath, "/" )
	strPath = left(strPath, nPos )

	Set Sh = CreateObject("") "cmd /K  cd /d " + strPath
end sub