Scripting Requests

Features wanted...
Post Reply
Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Scripting Requests

Post by Mesh »

Since I've been playing around with scripts, there are a few things that I wish XY did (or did differently), so I thought I'd mention them here for what it's worth.


1. Native support for looping through a list of selected items.

I know that Jacky created a workaround script, and it's works nicely. I'm just saying that this is a basic need that XY should support natively.


2. Remove indendation as an identifier.

I strongly dislike the fact that XY uses indentation to determine what belongs to what in a script. It's easy to mess up by mistake, and it gets in the way of people who have their own system of indenting to organize their code. XY should follow the standard that many programming languages use, and follow a brace delimited format. For example:

Code: Select all

Script/function Name()

{

Body of script.

}

3. Full support for conditionals.

This refers to supporting If/Else, For, While, etc... This is somewhat related to Item 2, because support for these items requires the ability to parse brace delimited sections of code.



Anyway, that's my list of major scripting requests for the moment. I don't know how much of this was already on Don's To Do list - all I could see was "Scripting 2.0", Scripting 3.0", etc... :)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Scripting Requests

Post by TheQwerty »

1 and 3 will come in time.

2, I'm torn. I use to prefer the brace way as well, and still do to an extent. But after learning some Python using whitespace is starting to grow on me.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

TheQwerty wrote:
1 and 3 will come in time.

2, I'm torn. I use to prefer the brace way as well, and still do to an extent. But after learning some Python using whitespace is starting to grow on me.

I've always liked managing my own whitespace. I use it to differentiate different levels and sections of code, but that becomes a lot more complicated as soon as it's parsed. Something as simple as loading source code in a different app might cause the whitespace to change, but no text editor is going to insert or remove braces on its own.

admin
Site Admin
Posts: 60604
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Requests

Post by admin »

Mesh wrote:
TheQwerty wrote:
1 and 3 will come in time.

2, I'm torn. I use to prefer the brace way as well, and still do to an extent. But after learning some Python using whitespace is starting to grow on me.

I've always liked managing my own whitespace. I use it to differentiate different levels and sections of code, but that becomes a lot more complicated as soon as it's parsed. Something as simple as loading source code in a different app might cause the whitespace to change, but no text editor is going to insert or remove braces on its own.
I agree. But the function blah (args) {body;} syntax depends on the keyword function which I currently don't have in XY scripting. So there is no clearly defined beginning of a section.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

admin wrote:
I agree. But the function blah (args) {body;} syntax depends on the keyword function which I currently don't have in XY scripting. So there is no clearly defined beginning of a section.

I understand, but for what it's worth, I think it would be an improvement to XY's scripting to incorporate that. The keyword / brace delineation structure is necessary for XY's scripting to evolve beyond the basics. You can't have proper support for conditionals without it, and once it's in, you might as well use it everywhere it would be a benefit to.

Quad Master
Posts: 32
Joined: 15 Sep 2008 07:28

Re: Scripting Requests

Post by Quad Master »

Conditional scripting would be great addition to XY's scripting and that would not be possible without { }
Blog : Quad Tek Using : XYplorer v7.60.0000, 09-Sep-2008
Quick Learning XY Newbie ;) [ My Wishlist | XYRoadMap | XYWiki ]

admin
Site Admin
Posts: 60604
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Requests

Post by admin »

Don't worry. There will be Conditional Statements and Looping Statements and there will be curly braces. It's on my list since long.

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

admin wrote:
Don't worry. There will be Conditional Statements and Looping Statements and there will be curly braces. It's on my list since long.

Excellent! Thank you, Don. :)

Demset
Posts: 50
Joined: 02 Nov 2008 06:22

Re: Scripting Requests

Post by Demset »

I was wondering if there had been any progress in regards to this wishlist. Working with XY's scripting, I found myself wishing for the exact same list of items. But I've been inactive for scripting for a little while, so I don't know if any of this has been addressed or not.

admin
Site Admin
Posts: 60604
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Requests

Post by admin »

Demset wrote:I was wondering if there had been any progress in regards to this wishlist. Working with XY's scripting, I found myself wishing for the exact same list of items. But I've been inactive for scripting for a little while, so I don't know if any of this has been addressed or not.
It's all there now. :)

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

admin wrote:
It's all there now. :)

Really? The help file still lists the following:

----------
One script can run over multiple lines. Simply indent the lines after the first line using any number of space or tab characters.
----------


That would imply that whitespace is still not freeform.

In addition, I just went through the entire command reference, and didn't find any command that allowed you to loop through a list of selected items.


Obviously, I'm missing something.

admin
Site Admin
Posts: 60604
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Scripting Requests

Post by admin »

Mesh wrote:
admin wrote:
It's all there now. :)

Really? The help file still lists the following:

----------
One script can run over multiple lines. Simply indent the lines after the first line using any number of space or tab characters.
----------


That would imply that whitespace is still not freeform.

In addition, I just went through the entire command reference, and didn't find any command that allowed you to loop through a list of selected items.


Obviously, I'm missing something.
I referred to "There will be Conditional Statements and Looping Statements and there will be curly braces. "

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

admin wrote:
I referred to "There will be Conditional Statements and Looping Statements and there will be curly braces. "

Actually, that wasn't clear from your post. Demset was asking about the whole list of items, and you replied by saying "it's all there now". I'm sure you can understand my confusion. :)

Mesh
Posts: 956
Joined: 24 Mar 2008 21:22

Re: Scripting Requests

Post by Mesh »

Since this thread is being discussed again, I wanted to point out that I think it makes it unnecessarily complicated that a script file can be a library of scripts.

I think each script file should be a single script, which executes as a whole. This becomes more feasable once XY supports creating your own functions. But once that's in place, I think we should get rid of the whole "script library" idea. Not only won't there be a need for it anymore, but it also makes it easy to get rid of the parsed whitespace issue.


I wonder whether it would be easier to have XY's scripting use Javascript as it's core language. That would address most of these issues, and take issues of language syntax out of Don's need to recalculate, now and then. UltraEdit's scripting works that way, and it makes things tidy, yet flexible.

Demset
Posts: 50
Joined: 02 Nov 2008 06:22

Re: Scripting Requests

Post by Demset »

Mesh wrote:
I wonder whether it would be easier to have XY's scripting use Javascript as it's core language. That would address most of these issues, and take issues of language syntax out of Don's need to recalculate, now and then. UltraEdit's scripting works that way, and it makes things tidy, yet flexible.

Oh, that would be sweet! I second this!

Post Reply