Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed script step not appearing #210

Open
nvcleemp opened this issue Jun 15, 2022 · 5 comments
Open

Installed script step not appearing #210

nvcleemp opened this issue Jun 15, 2022 · 5 comments

Comments

@nvcleemp
Copy link

This is probably more a support question than an actual issue, but I can't figure out how to use the BE_ScriptStepInstall function, and the documentation is not really helpful.

As an example I'm simply trying to make a script step to perform BE_DialogProgress.

I have tried:

BE_ScriptStepInstall ( "Show Progress Dialog" ; "<PluginStep><Parameter ID=\"0\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Title\"/><Parameter ID=\"1\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Description\"/><Parameter ID=\"2\" Type=\"Calc\" DataType=\"Number\" ShowInline=\"true\" Label=\"Maximum\"/></PluginStep>" ; 901 ; "Show a progress dialog" ; "BE_DialogProgress ( \"###0###\" ; \"###1###\" ; \"###2###\" )" )

and I have tried:

BE_ScriptStepInstall ( "Show Progress Dialog" ; "<PluginStep><Parameter ID=\"0\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Title\"/><Parameter ID=\"1\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Description\"/><Parameter ID=\"2\" Type=\"Calc\" DataType=\"Number\" ShowInline=\"true\" Label=\"Maximum\"/></PluginStep>" ; 901 ; "Show a progress dialog" ; "BE_DialogProgress ( ###0### ; ###1### ; ###2### )" )

Neither seem to be working. They also don't produce an error and I can see the script step in BE_DebugInformation.

Speaking of which... this is the output of BE_DebugInformation:

{
 "Curl Information" : {
  "Curl Options" : {
  },
  "Custom HTTP Headers" : {
  },
  "Custom SMTP Headers" : {
  },
  "HTTP Proxy Information" : {
   "Password" : "",
   "Port" : "",
   "Server" : "",
   "Username" : ""
  },
  "HTTP Response Code" : 0,
  "HTTP Response Headers" : "",
  "SMTP Attachments" : {
  },
  "SMTP Server Information" : {
   "Password" : "",
   "Port" : "",
   "Server" : "",
   "Username" : ""
  },
  "Trace" : ""
 },
 "Date" : "Wed Jun 15 15:29:14 2022",
 "FileMaker Information" : {
  "Application" : 1,
  "File ID" : 3,
  "Session ID" : 1,
  "Version" : "Pro 19.4.2"
 },
 "Last DDL Error" : 0,
 "Last Error" : 0,
 "Plugin Information" : {
  "Auto Update Version" : "04020400",
  "Version" : "4.2.4"
 },
 "Script Steps" : {
  "" : 852,
  "BE_DialogProgress ( \"###0###\" ; \"###1###\" ; \"###2###\" )" : 901
 },
 "Text Encoding" : "UTF-8"
}
@nickorr
Copy link
Member

nickorr commented Jun 21, 2022

Ok, so you do need to quote the text strings when you setup the function, so this is the example I tried :

BE_ScriptStepInstall ( "Show Progress Dialog" ; 

"<PluginStep>
	<Parameter ID=\"0\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Title\"/>
	<Parameter ID=\"1\" Type=\"Calc\" DataType=\"Text\" ShowInline=\"true\" Label=\"Description\"/>
	<Parameter ID=\"2\" Type=\"Calc\" DataType=\"Number\" ShowInline=\"true\" Label=\"Maximum\"/>
	</PluginStep>"
	
	 ; 1 ; "Show a progress dialog" ; "BE_DialogProgress ( \"###0###\" ; \"###1###\" ; \"###2###\" )" 
 
 )

Which works to create the script step ( you need to close and re-open the editor for it to appear ).

However when I run the step I get error -1. I'm looking into this one now.

Cheers,
Nick

@nickorr
Copy link
Member

nickorr commented Jun 21, 2022

Followup, that did work for me, the progress dialog appeared, just behind another window so I didn't see it at first. But I got the extra error dialog as well...

@nvcleemp
Copy link
Author

Hi Nick

Thanks. Closing and reopening the editor was the step that was missing. In hindsight, probably a logical step to take, but I think I just closed the whole database once, and didn't try to close just the editor afterwards.

I didn't get an error dialog, and the progress dialog appeared in the foreground. Anyway, this was just a proof of concept I was building, and I took the progress dialog because it would have given me immediate visual feedback to see whether the script step was successfully executed.

Maybe it is a good idea to include a small example of this functionality in the documentation as well as note that the editor window needs to be restarted.

Thanks a bunch!

Cheers
Nico

@nickorr
Copy link
Member

nickorr commented Jun 21, 2022

So you don't get the same error dialog that I did? What platform and what versions of everything ( OS, FMP, BE )

Thanks,
Nick

@nvcleemp
Copy link
Author

No, I don't get an error dialog, and I even checked with Get ( LastError ) and BE_GetLastError: no errors are raised.

This is my setup:

  • OS: Windows 11 Pro
  • FM: Pro 19.5.1
  • BE: 4.2.4
{
 "Curl Information" : {
  "Curl Options" : {
  },
  "Custom HTTP Headers" : {
  },
  "Custom SMTP Headers" : {
  },
  "HTTP Proxy Information" : {
   "Password" : "",
   "Port" : "",
   "Server" : "",
   "Username" : ""
  },
  "HTTP Response Code" : 0,
  "HTTP Response Headers" : "",
  "SMTP Attachments" : {
  },
  "SMTP Server Information" : {
   "Password" : "",
   "Port" : "",
   "Server" : "",
   "Username" : ""
  },
  "Trace" : ""
 },
 "Date" : "Fri Jun 24 13:00:42 2022",
 "FileMaker Information" : {
  "Application" : 1,
  "File ID" : 17,
  "Session ID" : 1,
  "Version" : "Pro 19.5.1"
 },
 "Last DDL Error" : 0,
 "Last Error" : 0,
 "Plugin Information" : {
  "Auto Update Version" : "04020400",
  "Version" : "4.2.4"
 },
 "Script Steps" : {
  "BE_DialogProgress ( \"###0###\" ; \"###1###\" ; \"###2###\" )" : 901
 },
 "Text Encoding" : "UTF-8"
}

minstral added a commit that referenced this issue Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants