You are here: PSPad forum > English discussion forum > Re: Scripting: name of the current project?

Re: Scripting: name of the current project?

#1 Scripting: name of the current project?

Posted by: L.Willms | Date: 2015-11-06 14:57 | IP: IP Logged

Is there a system variable for scripting returning the name of the current project?

I know the projectFileName and I could extract the project name as the base name of the file name using the FSO in VB Script, but maybe there is the simpler way of giving the project name directly, simpler of course for the script programmer.

BTW, I am completely new to PSPad which I try as an alternative to the good old Phase 5 HTML editor, which is missing UTF-8 support. I am living in Frankfurt, Germany.

I have already written a PSPad-script for calling the FTP-Uploader from the same company as Phase5 (Phase 5 supports calling FTP-Uploader natively) and I would like to be able to call the FTP-Uploader with the project name as command line parameter (I am in contact with the FTP-Uploader's programmer for adding such a command line parameter).

Options: Reply | Quote | Up ^


#2 Re: Scripting: name of the current project?

Posted by: pspad | Date: 2015-11-06 15:43 | IP: IP Logged

There is a variable %ProjectName% what can return you what you need.

Options: Reply | Quote | Up ^


#3 Re: Scripting: name of the current project?

Posted by: L.Willms | Date: 2015-11-06 18:42 | IP: IP Logged

A variable "ProjectName" is being rejected in VB Script as unknown variable, and "%ProjectName%" as having invalid characters "%" in it.

I am using PSPad 4.6.0 (2700).

Options: Reply | Quote | Up ^


#4 Re: Scripting: name of the current project?

Posted by: pspad | Date: 2015-11-06 18:55 | IP: IP Logged

It works. For VBScript test this code:
Echo(getVarValue("%ProjectName%"))

Options: Reply | Quote | Up ^


#5 Re: Scripting: name of the current project?

Posted by: L.Willms | Date: 2015-11-06 21:03 | IP: IP Logged

Whow! Yeah, that worked. Thanks a lot! I think I have surmounted a strong barrier to PSPad scripting.

I learned how a PSPad variable is to be expressed and evaluated in VBScript.

Is there a list of such variables somewhere?

As to scripting, until now, I looked only in the file Scripting.rtf which is located in the PSPad program directory (dated 2015-05-26 12:49), and there is only a "getVariable" function. By googling I found a "Script Language Reference" as gogogadgetscott.info where a GetVarValue is listed.

And finally I looked up the program's help menu...

Ah, those inevitable detours and circles at the beginning of the learning curve...

Thanks again.

Options: Reply | Quote | Up ^


#6 Re: Scripting: name of the current project?

Posted by: pspad | Date: 2015-11-07 02:45 | IP: IP Logged

You can use PSPad help - there is scripting description, same as on the gogogadgescot page.
I will update both - help and scripting.rtf

Now you can look at variables in PSPad:
menu settings / Variables
menu settings / Highlighter setting / Right click on the parameter field

Function getVarValue() I mentioned above returns you content of the system variables too like %UserProfile%, %APPPath%, %Temp%, e.t.c. - everything you can list in the list with SET commant in the command line window

Options: Reply | Quote | Up ^


#7 Re: Scripting: name of the current project?

Posted by: L.Willms | Date: 2015-11-07 05:28 | IP: IP Logged

Danke schön and Thanks again!

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR