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

Discuss and share scripts and script files...
Post Reply
MBaas
Posts: 572
Joined: 15 Feb 2016 21:08

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

Post 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?
______________________________________________
Happy user ;-)

klownboy
Posts: 4089
Joined: 28 Feb 2012 19:27

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

Post 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.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13260
Joined: 06 Feb 2011 00:33

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

Post 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...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

MBaas
Posts: 572
Joined: 15 Feb 2016 21:08

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

Post 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:
______________________________________________
Happy user ;-)

Post Reply