Page 1 of 1
changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 5:02 pm
by adventuresofgreg
Hi: I have written an app that allows me to type a custom script into a field, then that field is inserted into the script of a button and run. It works fine on my LiveCode dev app, but won't work properly on the Standalone version for Windows. I have written scripts that edit scripts of other buttons, and it has seemed to work in the past. The only thing I am doing differently here is that I am replacing the entire script of a button with a new script that was created in a field in the standalone. Any ideas why this won't work?
Thanks
Greg
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 5:12 pm
by Klaus
Hi Greg,
there is a SCRIPTLIMIT in standalone apps!
Check "scriptLimits" in the dictionary, looks like your modifications are exceeding them.
Best
Klaus
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 5:28 pm
by adventuresofgreg
Hi Klaus. I see that, yes... hmm... Do you have any suggestions as to how I can accomplish this. Here is what I need to do:
I have a library of scripts - each saved as a separate text file. I can import each script, make changes, save the text file, put it into a button, and activate it. This works fine in the native LC app, but because these scripts are all longer than 10 statements, it won't work in my standalone.
The reason don't just make a handler, function or button for each script is that I would like to be able to EDIT and CREATE the scripts in the standalone. The scripts that I am writing are a kind of custom, simplified version of LiveCode script for data analysis. I have another script in my application that processes my simple custom script, and converts it to a standard LiveCode script that can be run on the data.
For example, rather than going through the laborious process of parsing the data, putting it into an array, then typing specific code like "put VAR1 into item 6 of myData[x-4]" , my custom script does all the pre-processing automatically, and then allows the user to type simple code like:
" $RSI,-4=Var1 " , then when I process that, my handler converts it to LiveCode script that includes the creation of the array, the preprocessing, etc.
Thanks,
Greg
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 5:31 pm
by Klaus
Hi Greg,
sorry, no suggestion...
Best
Klaus
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 6:54 pm
by jacque
adventuresofgreg wrote:
The reason don't just make a handler, function or button for each script is that I would like to be able to EDIT and CREATE the scripts in the standalone.
That's pretty much why the script limits exist. Allowing users to edit and create scripts in a standalone would give them the ability to create a competing IDE, which isn't allowed.
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 7:04 pm
by adventuresofgreg
jacque wrote:adventuresofgreg wrote:
The reason don't just make a handler, function or button for each script is that I would like to be able to EDIT and CREATE the scripts in the standalone.
That's pretty much why the script limits exist. Allowing users to edit and create scripts in a standalone would give them the ability to create a competing IDE, which isn't allowed.
yes - I see that. If you could write scripts in a field in a standalone, you could write your own IDE and compete with LC. However, I'm trying to do something quite different than that. In a sense, I'm attempting to write my own, custom scripting language for a vertical market. The road block, is after the script has been written, and converted to LC script, there is no way to RUN it because LC see's it as a script that was generated from within the standalone, and the script limit comes into effect.
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 8:40 pm
by sturgis
Not sure this would be acceptable for what you're trying to accomplish, but if you have also purchased lc server, you can generate your custom script, drop it into a text file and use lc server to run it. You can do this with shell and have lc server return the results get("livecodeserver filetobeprocessed") or if you go ahead and set up lcserver with a website you can post data to it for processing. (This could include the actual script I believe. IE post the script and the data, have lcserver create a script file, then include the same file, process the data, and return the results.)
Not sure if such a roundabout solution would be acceptable, but thought I'd toss it out there.
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 8:53 pm
by adventuresofgreg
sturgis wrote:Not sure this would be acceptable for what you're trying to accomplish, but if you have also purchased lc server, you can generate your custom script, drop it into a text file and use lc server to run it. You can do this with shell and have lc server return the results get("livecodeserver filetobeprocessed") or if you go ahead and set up lcserver with a website you can post data to it for processing. (This could include the actual script I believe. IE post the script and the data, have lcserver create a script file, then include the same file, process the data, and return the results.)
Not sure if such a roundabout solution would be acceptable, but thought I'd toss it out there.
Thanks Sturgis. I can see how that would work, but you are right, but's a bit of a round-a-bout way. My primary goal regarding getting the custom scripts to work in a standalone is for very large data processing jobs where I might typically generate many versions of the same standalone, and run them all on a number of CPU's. However, I can simply set the scripts up accordingly on the native OSX box, then generate a number of specific standalones and distribute those to the network of CPU's. It's just that each time I need to change the scripts, I would need to regenerate the standalones.
Re: changing the script of a button in a standalone
Posted: Mon Jan 21, 2013 9:09 pm
by sturgis
Oh! Well then the possibility I offered might actually be useful. If you have a multicore web server you can hand off jobs to the server and have the standalone gather results as they are completed. If the processing time for each job is long, it might require some re-adjustment of the web server to do it that way. (adjusting timeouts) Or, again if you're using a farm of machines and processors, same deal. 1st create the script file, then use rpc (or whatever method you prefer) to launch an lc server process with the filename of the script as argument. Have the scripts output results to a file where they can be gathered back up.
Again, rather convoluted, but.. well the webserver possibility especially is nice since they already have multithreading, and if you have a farm of servers with load balancing you can submit all jobs to 1 server and it will split them up and process as needed. (I think)
The other option might be to contact
support@runrev.com and see if they can give special dispensation for your specific need.
Re: changing the script of a button in a standalone
Posted: Tue Jan 22, 2013 7:43 am
by shaosean
The scriptLimits should be removed as the standalone engine can no longer compile apps anyways and there is no longer a starter version of the IDE..
Re: changing the script of a button in a standalone
Posted: Tue Jan 22, 2013 3:32 pm
by FourthWorld
If scriptLimits were removed there would be no difference between the IDE and standalone versions with regard to being able to prevent someone from making a competing product. I believe the RealBASIC EULA goes even further, preventing not only scripting but also any sort of tool that could be seen as competing.
In the rare cases where someone may truly need scriptLimits removed, Kevin encourages the developer to contact RunRev with the request. I believe this has been done once before, maybe more, but it's such a rare case that it's truly needed that it doesn't come up often. Fortunately, when it has RunRev has been flexible and accommodating.
Re: changing the script of a button in a standalone
Posted: Wed Jan 23, 2013 8:11 am
by shaosean
If the scriptLimits were removed, then the product would run the same in the IDE as in the compiled application, except with the exception of being able to compile which is only available in the IDE engine (it was removed from the standalone engine a few versions ago).. While the RS EULA has a clause forbidding it, there is no artificial limits added to the compiled apps to actually stop it from being done..