Se Connecter:     


Forum: General Discussion

Sujet: Script School - Page: 52
Example of the deepest you can go with ` " '


set result 0 & set a 1 & set b 2 & set c 4 & set d 8 & set e 16 & set f 32 & set g 64 & set h 128 & param_add `param_add "param_add 'get_var a' 'get_var b'" "param_add 'get_var c' 'get_var d'"` `param_add "param_add 'get_var e' 'get_var f'" "param_add 'get_var g' 'get_var h'"` & param_cast & set result & var_list


So the first bit is just setting some variables, no need to explain
then we say param_add and our param is a script action so we open a ` then our script action is param_add again and the param for that is a script action so we open a " then our script action is param_add again and it's params are also a script action so we open a '
this 3rd level of param_add, the ' is open the first param is get_var a, so then we close the ' , we're onto the 2nd param for the 3rd param_add so we open another ' get_var b the close the '
that completes the 1st param for the 2nd param add so we close the "
we're now onto the 2nd param of the 2nd param_add so we open another " and so on.

This is a pretty dumb example but this is as deep into script inception you can go.
And I have gone that deep in some cases.

One thing I dislike is spaces in fx names, the fx name needs to be wrapped in ' or " and that means I can go 3 levels deep with echo but I can't go as deep with "mt delay"
that's why all my fx I've created never contain a space, sometimes I use camelCase, sometimes I use under_score
that said it's a super rare case that I have to go that deep and I can work my way round it usually, but it would be nice if fx names were under_scored instead of containing spaces.
But script is a language, languages are never 100% consistent.
 

Is it possible to script a custom button to add a shortcut to the focused folder from the Folder List for quick access? It should work like the button in sideview: Leftclick = Add shortcut, Rightclick = Delete shortcut, Buttontext = Foldername?
Now i have the edit the custum button script ex. browser_shortcut 1 every time i want to change it.
 

browser_shortcut with no param and it will default to the next available number, deleting - since you're using the mouse already just right click the shortcut.
 

Thanks Locodog, but i want the button to act like a shortcut not only add a shortcut to the side toolbar.
Like this:
 

name buttons
`browser_shortcut NUM`
script buttons
browser_shortcut NUM

use the button with the first empty name for new shortcut
 

Thanks, it works great, but the button name doesnt work. I have tryed to copy your text
`browser_shortcut NUM`
, tryed to change ` to ', ´ and ". No name in the button after shortcut is created
 

you are using an actual number and not using the text NUM, right?
 

How stupid I am :-). Now it works exactly as I want it to be. Thanks!
 

DeejayHawkeye wrote :
...Now it works exactly as I want it to...


That is a testament to vdj, and tuned in users just making stuff for themselves, with a little help.
User: I want a thing, can I do the thing ?
Technician: sure do this.
User: result!

It's only those with a terminal lack of imagination that want it with no effort on their part.
"It just works" mentality also means "completely limited feature set"

I doubt even the devs considered this, but they made it possible, and it's a bloody good idea, I think I'll bake it into my house keeping skin because it will save me time.