Hi,

I would like a script that opens a file in PSPad using an open dialog with a
fixed path. 

Can this be done with pspad scripting commands?

I've tried it with a JScript but I get an error:
  try
  {
    var objShell, objDialog, appDataPath;
    
    objShell = new CreateObject("WScript.Shell");
    appDataPath = objShell.SpecialFolders("AppData");
    objDialog = new CreateObject("UserAccounts.CommonDialog");
    objDialog.InitialDir = appDataPath;
    objDialog.Filter = "All files (*.*)|*.*;Log files (*.txt)|*.txt;Log files
(*.log)|*.log";
    if (objDialog.ShowOpen())
    {
      echo(objDialog.FileName);
    }
    else
    {
      echo("cancelled");
    }
  }
  catch (err)
  {
    echo(err.message);
  }


But this failes at the line
objDialog = new CreateObject("UserAccounts.CommonDialog"); 
with the message "object doesn't support this property or method.

-- 
<http://forum.pspad.com/read.php?2,59952,59952>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem