Plugin Bug: Unknown type: 'TAction'

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

Plugin Bug: Unknown type: 'TAction'

Postby pmk65 » Fri Nov 16, 2018 1:36 pm

If I create a simple plugin with this code:

Code: Select all
function MyPlugin(Sender) {
  Script.Message("Sender: " + _t(Sender));
  Script.Message("Sender FileName: " + _t(Sender.FileName));
}

Script.RegisterAction("", "My Plugin", "", "MyPlugin");


Then I get the following error in line 3 (the one with Sender.FileName):

Plugin "MyPlugin": Line 3:3: Unknown type: 'TAction'

I'm pretty sure this worked before.

---------------------------------------------

And another bug?

If I read the value of "Document.FileName", modify it and write it back, then the next time I try to read it, the "Document.FileName" property returns an empty string.


Using WeBuilder 15.4.0.206
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Plugin Bug: Unknown type: 'TAction'

Postby Aivars » Fri Nov 16, 2018 3:38 pm

I don't see how it could have worked, because Sender for actions is not TScriptableDocument but either TAction itself or maybe the menu item or button that triggered the action...

Regarding the second problem - if FileName is set to invalid or unexisting file path then Document.FileName will return an empty string. It's done to avoid receiving gibberish e.g. when file is created but not yet saved then the actual FileName would contain string info that is not really a file name and thus would confuse the plugin code.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Plugin Bug: Unknown type: 'TAction'

Postby pmk65 » Fri Nov 16, 2018 4:06 pm

Aivars wrote:I don't see how it could have worked, because Sender for actions is not TScriptableDocument but either TAction itself or maybe the menu item or button that triggered the action...

My mistake. When using events the Sender is a TScriptableDocument , and that was the one I was thinking of. ;p

Aivars wrote:Regarding the second problem - if FileName is set to invalid or unexisting file path then Document.FileName will return an empty string. It's done to avoid receiving gibberish e.g. when file is created but not yet saved then the actual FileName would contain string info that is not really a file name and thus would confuse the plugin code.


I know, but I only changed the file extension of the path/name. So the path is valid. (I want to be able to switch the filetype/code highlighting of the current file)

Example:
Filename before: c:\test\file.js
Filename after: c:\test\file.php
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: Plugin Bug: Unknown type: 'TAction'

Postby Aivars » Tue Nov 20, 2018 3:59 pm

Does c:\test\file.php physically exist on the drive?
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2453
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: Plugin Bug: Unknown type: 'TAction'

Postby pmk65 » Tue Nov 20, 2018 4:20 pm

Aivars wrote:Does c:\test\file.php physically exist on the drive?


No. I just want to be able to switch between filetypes/highlighting from my plugin.
It wotks the 1st time I do it (provided that he file has been saved), but the 2nd time the filename is empty. I also set Editor.Modified = true, to indicate something has changed, but still blank filename
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 14 guests