Page 1 of 1

Find and Replace for Script and Expression Elements

Posted: 22 Jun 2019 06:48
by Pepy
Could be that I'm bad at searching but I'm surprised something like this hasn't been requested yet.

This could be useful:
  • when you want to change all instances of a variable's name.
  • for editing flow descriptions. For example, I often write "This flow works in conjunction with flow_name" to explicitly state that they cannot function without one another so if I were to change the name of the mentioned flow, I would have to go through and update the name of the flow in the description of all flows where it is mentioned.
  • making small grammar changes. This one might be stupid, but I occasionally change a word from time to time whether it's something as simple as adding a hyphen in between or changing the casing of words. Having to go through each and every instance of this in every flow description is an absolute pain.

Re: Find and Replace for Script and Expression Elements

Posted: 22 Jun 2019 11:01
by webtrekker
Yes, this would be very useful.

I now edit most scripts in Notepad++ on my PC, where I can use more powerful features, such as the Find/Replace mentioned to change the name of all instances of a particular variable in the script. Syncing between Notepad++ and my PC is easily done using ClipSync on my Android phone, as I've described in another recent post.

Re: Find and Replace for Script and Expression Elements

Posted: 22 Jun 2019 21:17
by Pepy
Good idea using a third-party app to edit code and then copying it over; this way you won't have to worry about other things in addition to this such as spacing and tabs plus the fact that you can have a more customizable theming experience as well. I've given ClipSync a try in the past, but don't remember why I ended up uninstalling it, perhaps because Pushbullet already offers that functionality in addition to many more.

Thanks for your suggestion, I'll be using Atom editor to edit the code and then then using Pushbullet to transfer the code for now, at least until the built-in editor gets better. But using this method you would lose the functionality to insert snippets, variables and functions directly into the code. It's also going to be quite annoying to have to copy and paste the code over every time you want to test it out.

Re: Find and Replace for Script and Expression Elements

Posted: 23 Jun 2019 17:33
by Desmanto
+1 for this.
I also use Notepad++, mirrored using scrcpy for flow overview. But if I don't have access to PC, I use MiXplorer text/code editor instead. It has the standard feature that notepad++ has.

Maybe script editor UI can be added with some extra feature : Line numbers, find and replace, go to, custom user function (similar to autotext). This works only for this script/expression/control UI. For all flow replacing, it is quite dangerous, so I would not recommend it.

Re: Find and Replace for Script and Expression Elements

Posted: 23 Jun 2019 22:46
by Pepy
Desmanto wrote:
23 Jun 2019 17:33
Maybe script editor UI can be added with some extra feature : Line numbers, find and replace, go to, custom user function (similar to autotext). This works only for this script/expression/control UI. For all flow replacing, it is quite dangerous, so I would not recommend it.
I've already sent a request to Martin (to which he added to his to-do list) for line numbers. I can add them to this thread though and make the title more generic (eg. Script Enhancements).