Suggestion: 'Splice' command for WS

Hello everyone.

I'm developing a (new) iTunes script and I've hit a wall. I'll try to explain my problem:

I would like to be able to select/input cover size for an iTunes source script. So far I've been able to 'cheat' a value in the "CurrentUrl" output, as

Total output:
output["CurrentUrl"]= https://itunes.apple.com/lookup?media=music&entity=song&limit=200&country=jp&width=1200&id=505371XXX where &width=1200 is the value I want.

This would be "easily" achieved if there was a way to 'splice' an output S into the current buffer, as in (example):

Script-Line : xx
Command : splice
Parameter 1 : Output "CurrentUrl" (or another)

Output : ><

Line and position:
results
.... ^

would return

Line and position:
resitunes.apple.com/lookup?media=music&entity=song&limit=200&country=jp&width=1200&id=50537145ults

or some command akin to Replace where the second parameter would be an output. Then with further processing I could get the "1200" value to the artwork url.

PS: I know about 'Adjust cover' that would achieve the same purpose for this example, but a 'Splice' command could have other uses regarding WS scripting.

Thank you.

With version 3.22 and the addition of a configuration schema, the previous suggestion becomes (more) viable.

Instead of 'cheating' a value in CurrentUrl, I'm revising the suggested 'splice' command into a SayVar "key" command, with the idea of user inputs from the dedicated Settings menu item being called directly in the script.

Example:

Currently, adding an input box in the settings file, like

  "type": "number",
	  "key": "testNumber",
	  "title": "Enter cover size",
	  "description": "Enter a number",
	  "default": 42

and calling it in the script, using IfVar

IfVar "testNumber" "42"
	...
	replace "600x600bb" "42x42bb"
EndIf

is working. This example allows to define a cover size in the settings menu, and get the cover art in that size; but only if the input is "42".

For this example to work with any input number, it would imply coding IfVar clauses for every numeric value, which is impractical. Instead, with a dedicated command, the value would be called directly into the current buffer, like

...
replace "600x600bb" ""
SayVar "testNumber"
Say "x"
SayVar "testNumber"
Say "bb"
...

which would return the same results as before (42x42bb), but would also allow for any numeric/string value to be used.

Another example would be to get the current values on the settings schema in an output, like

OutputTo "CurrentSettings"
Say "testChoices:"
SayVar "testChoices"
Say "|"
Say "testEnter:"
SayVar "testEnter"
Say "|"
Say "testNumber:"
SayVar "testNumber"
Say "|"
Say "testCheck:"
SayVar "testCheck"
Say "|"
...

which would be useful, for example, in debugging.

This is merely a (revised) suggestion for consideration. Feedback would be appreciated.

I also want something like SayVar "variable". And in the [IndexUrl]/[AlbumUrl] and [SearchBy] the possibility to use $var(variable).

I would like to be able to do that too, but from my current understanding of the WS framework structure, I don't think that will be a possibility (for now / if ever). And since it's already possible to call settings' %variables% from a script with IfVar in [ParserScriptIndex] and [ParserScriptAlbum], I'd like to believe that the groundwork for a possible SayVar is already laid out, and this suggestion isn't too far-fetched.

I've had a breakthrough regarding this topic, and managed to call a number input from 'Settings' and import it into an %output% in an efficient manner. For anyone interested, please check