Yes, the quick open dialog always uses the path of the active document as starting directory and it is not possible to configure the directory. Most users of UltraEdit working with projects use the Project tab of the File Tree View or the Project Settings dialog to open a file from the project. UEStudio has additional commands for quickly open a project file.
However, to help you with your requirement on quick file open I wrote a small script to do this task.
- Code: Select all
var sFilename = "";
// getString to variable is not working if no document window open.
if (UltraEdit.document.length < 1) {
UltraEdit.newFile();
sFilename = UltraEdit.getString("Enter name of file(s) to open:",1);
UltraEdit.closeFile(UltraEdit.activeDocument.path,2);
} else {
sFilename = UltraEdit.getString("Enter name of file(s) to open:",1);
}
if (GetListOfFiles(0,"C:\\Project\\",sFilename,true)) {
var nListFile = GetFileIndex();
while (UltraEdit.document[nListFile].isEof() == false) {
UltraEdit.document[nListFile].startSelect();
UltraEdit.document[nListFile].key("END");
sFilename = UltraEdit.document[nListFile].selection;
UltraEdit.document[nListFile].endSelect();
UltraEdit.document[nListFile].key("HOME");
UltraEdit.document[nListFile].key("DOWN ARROW");
var nFileToOpen = GetFileIndex(sFilename);
if (nFileToOpen < 0) UltraEdit.open(sFilename);
else UltraEdit.document[nFileToOpen].setActive();
}
UltraEdit.closeFile(UltraEdit.document[nListFile].path,2);
}
You have to include additionally the script code for the functions
GetListOfFiles and
GetFileIndex. And you have to change the string "
C:\\Project\\" to path of your project directory. (There is no variable containing the project directory path as defined in the project settings dialog.)
Add this script to
Scripting - Script List and assign a hotkey to the script for fast executing it.
You should also uncheck
Show status information in output window at
Advanced - Configuration - Scripting to avoid loosing the content of active output window on every execution of this script.