I think separate script editor would be better - no plugin overload and easier update.
If you need to know how VPBatch works here it is:
Code: Select all
int TCExecuteVPCommand(HWND hMainWnd, const wchar_t* Command, const wchar_t* RootName=0, const wchar_t* RemotePath=0) {
vptr<wchar_t> data(lstrlen(RootName)+lstrlen(RemotePath)+lstrlen(Command)+4);
lstrcpy(data()+wsprintf(data(), L"%s\r%s", RootName ? RootName : L"", RemotePath ? RemotePath : L"")+1, Command);
COPYDATASTRUCT cds={'P\0V', data.size()*sizeof(wchar_t), data()};
return SendMessage(hMainWnd, WM_COPYDATA, 0, (LPARAM)&cds);
}
It just sends WM_COPYDATA message with special contents that VP understands. You may get data format from piece of code above.
If you need to set script contents, you need to use following command string:
<edit path_to_script_file {new_script_contents}
It would be useful for script editor to add indentation spaces or tabs for nested script block contents - e.g. like this:
Code: Select all
<ifok "Do you wish to save state?" {
<ifok "You really want to continue?" {
<silent Ready to save script, go on
<save
}
{
<silent User afraids to save something, do nothing
}
}
{}
As you can see from given batch, currently you may get virtual script file path using
%L (don't forget to remove VP room name at the beginning) or using
"%%${}Path%%\" with
%F (also third case is possible - just
"%%${}Path%%\"%S1 - but it may have problems in case of short script file name if TC will pass it w/o quotes - char '>' has special meaning). And, you may send current script text to script editor using %P%N parameter - so script editor will accept two parameters - script file name and initial script text - then parse text and extract icon path and format text. After editing text editor will remove line breaks and indentation spaces or tabs and append '<<' with icon path.