Page 1 of 1

#172; non-blocking? (It has gotten me again)

Posted: 06 Feb 2021 15:13
by MBaas
While ago I was struggling with #172; in a script and now it hit me again in a different one.

I'm trying to let the user rename a file. But if I do that with #172; - execution of the script just goes across this command and user does not get a chance to rename. If I run that with the tracer - the filename gets highlighted (as it would have to be for the renaming)...but instantly the script continues - so there is no chance for the user to interact.

So I went back to the old discussion and saw highend's remark " #172 is a non blocking command, it will return immediately once it was invoked." - yes, that is exactly what I was observing. I then went to the help to see if it has anything to say about "non blocking" commands (or blocking commands) - but nope. Is there any way to achieve the intended behavior or do I need to get the filename via input?

Re: #172; non-blocking? (It has gotten me again)

Posted: 06 Feb 2021 15:31
by klownboy
I don't know your specifics, but could you use SC rename instead of #172. Are you renaming currently selected files? There are plenty of options available with SC rename including moving while renaming.

Re: #172; non-blocking? (It has gotten me again)

Posted: 06 Feb 2021 16:22
by highend
I then went to the help to see if it has anything to say about "non blocking" commands (or blocking commands) - but nop
Commands = No return value, the script will not wait for any return value
Everything that has () at the end is a function with a return value, the script doesn't continue without getting the value first...

Re: #172; non-blocking? (It has gotten me again)

Posted: 06 Feb 2021 17:41
by MBaas
@klownboy: I am pasting clipboard content into a file - and the script has no clue what type of file it is. I am dealing with lots of different extensions for text-files - so I need to give it a name after its created. If #172 can't be used, rename will have to the l-option and get a name via input...

@highend: thanks for that clarification - got it now! :wink: