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

Discuss and share scripts and script files...
Post Reply
MBaas
Posts: 654
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 with Screen scaling 100% and W11Pro 24H2 ;-)

klownboy
Posts: 4398
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

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.

highend
Posts: 14578
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

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

MBaas
Posts: 654
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 with Screen scaling 100% and W11Pro 24H2 ;-)

Post Reply