Page 3 of 28
Posted: 21 Feb 2008 21:18
by TheQwerty
admin wrote:TheQwerty wrote:Any chance we could get a way to have global variables that can be used/set in Sub() and Load() commands?
I've got some scripts in mind but without such functionality they can't happen.
Somebody had to pop this question sooner or later, and the answer is: Yes!

-- But not now.

(By coincidence this afternoon I thought about it and found a cool way to implement it, resp. saw how easy it is to implement.)
Oh sure, in one breath say "not now" and then in the next say that it's incredibly easy to do.
That's just going to make me have hope with each new beta post that today will be the day, only to have to go back to waiting patiently.

Posted: 21 Feb 2008 21:21
by admin
TheQwerty wrote:admin wrote:TheQwerty wrote:Any chance we could get a way to have global variables that can be used/set in Sub() and Load() commands?
I've got some scripts in mind but without such functionality they can't happen.
Somebody had to pop this question sooner or later, and the answer is: Yes!

-- But not now.

(By coincidence this afternoon I thought about it and found a cool way to implement it, resp. saw how easy it is to implement.)
Oh sure, in one breath say "not now" and then in the next say that it's incredibly easy to do.
That's just going to make me have hope with each new beta post that today will be the day, only to have to go back to waiting patiently.

Hehe. You know, even an easy-to-do thing can turn into a can of worms -- I don't need such a can right now, I'm happy without it. First v7.0 must come out!
Re: Minor scripting related wishes (a generic thread)
Posted: 19 Aug 2008 21:01
by TheQwerty
It would be nice if inputFile were not so melodramatic when given a non-existent path.
Perhaps instead of throwing a hissy fit and exiting the script, plus lying ("Script terminated by user"), it could default to My Documents like inputFolder?
Or perhaps a new command:
checkPath(OutputVar, [Path])
Sets, outputvar to -1 if path is not found/valid.
...., 0 if path exists but identity cannot be determined.
...., 1 if path exists and is a directory.
...., 2 if path exists and is a file.
Re: Minor scripting related wishes (a generic thread)
Posted: 20 Aug 2008 10:17
by admin
TheQwerty wrote:It would be nice if inputFile were not so melodramatic when given a non-existent path.
Perhaps instead of throwing a hissy fit and exiting the script, plus lying ("Script terminated by user"), it could default to My Documents like inputFolder?
Or perhaps a new command:
checkPath(OutputVar, [Path])
Sets, outputvar to -1 if path is not found/valid.
...., 0 if path exists but identity cannot be determined.
...., 1 if path exists and is a directory.
...., 2 if path exists and is a file.
checkPath... this kind of stuff will come when I add conditions.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 15:53
by TheQwerty
admin wrote:checkPath... this kind of stuff will come when I add conditions.
I had thought as much. I'm glad you didn't make me wait till scripting 2.0 for that default action, but I'm also conflicted about that warning/error dialog.
On the one hand:
It's inconsistent with inputFolder which doesn't notify you that the supplied path cannot be found and just uses My Documents.
It's annoying to have another step/dialog there.
On the other hand:
It's not as disorienting to the user when they arrive at the unexpected folder.
It also may prevent confusion if the user intended to go to a folder which looks the same as their My Documents.
I'm just thinking in type with that. I guess it makes most sense to leave it as is and when we get conditionals we'll be able to program around that dialog anyhow.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 16:00
by admin
TheQwerty wrote:admin wrote:checkPath... this kind of stuff will come when I add conditions.
I had thought as much. I'm glad you didn't make me wait till scripting 2.0 for that default action, but I'm also conflicted about that warning/error dialog.
On the one hand:
It's inconsistent with inputFolder which doesn't notify you that the supplied path cannot be found and just uses My Documents.
It's annoying to have another step/dialog there.
On the other hand:
It's not as disorienting to the user when they arrive at the unexpected folder.
It also may prevent confusion if the user intended to go to a folder which looks the same as their My Documents.
I'm just thinking in type with that. I guess it makes most sense to leave it as is and when we get conditionals we'll be able to program around that dialog anyhow.
The best would be you pass a path that actually exists.
Oh, I just saw if you don't pass a path at all it defaults to
app path! So maybe it should also take app path in case of non-existent path!?
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 16:21
by TheQwerty
admin wrote:The best would be you pass a path that actually exists.

I'd do that... if I only had a way of determining that the path actually exists before placing my call. Maybe some type of test that would allow me to do different things based on various logic and conditions.
admin wrote:Oh, I just saw if you don't pass a path at all it defaults to app path! So maybe it should also take app path in case of non-existent path!?
Hmmm.. I think both inputFile and inputFolder should have the same behavior if possible, and they should go to the same path whether the argument is not supplied or not found.
But I'm not sure where that place should be; <xypath> might make the most sense here.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 19:55
by admin
TheQwerty wrote:admin wrote:The best would be you pass a path that actually exists.

I'd do that... if I only had a way of determining that the path actually exists before placing my call. Maybe some type of test that would allow me to do different things based on various logic and conditions.
admin wrote:Oh, I just saw if you don't pass a path at all it defaults to app path! So maybe it should also take app path in case of non-existent path!?
Hmmm.. I think both inputFile and inputFolder should have the same behavior if possible, and they should go to the same path whether the argument is not supplied or not found.
But I'm not sure where that place should be; <xypath> might make the most sense here.
FYI, the behavior of inputFolder (default to MyDocs on non-exist and on empty) is built into the Shell Browse For Folder dialog (which I just call from XY).
I think for a portable app <xypath> is the better default choice.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 20:11
by TheQwerty
admin wrote:FYI, the behavior of inputFolder (default to MyDocs on non-exist and on empty) is built into the Shell Browse For Folder dialog (which I just call from XY).
Right, but can't you give it a starting path? Or does the Win32API only allow you to define the root? (Quite frankly I hate that dialog just because you can't type a path in it.)
admin wrote:I think for a portable app <xypath> is the better default choice.
I agree.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 20:15
by admin
TheQwerty wrote:admin wrote:FYI, the behavior of inputFolder (default to MyDocs on non-exist and on empty) is built into the Shell Browse For Folder dialog (which I just call from XY).
Right, but can't you give it a starting path? Or does the Win32API only allow you to define the root? (Quite frankly I hate that dialog just because you can't type a path in it.)
admin wrote:I think for a portable app <xypath> is the better default choice.
I agree.
Sure I can give it an initial path. Only if that path does not exist it defaults to MyDocs.
Anyway, I just changed both commands:
Code: Select all
* Scripting commands inputfile and inputfolder modified:
- Now, when the path argument is left empty the initial path in
the select file/folder dialog defaults to <xypath>.
- Now, when the path argument contains a non-existent path, the
initial path in the select file/folder dialog defaults to
<xypath>. You are prompted whether to continue the script.
Re: Minor scripting related wishes (a generic thread)
Posted: 21 Aug 2008 20:21
by TheQwerty
admin wrote:Anyway, I just changed both commands:
Code: Select all
* Scripting commands inputfile and inputfolder modified:
- Now, when the path argument is left empty the initial path in
the select file/folder dialog defaults to <xypath>.
- Now, when the path argument contains a non-existent path, the
initial path in the select file/folder dialog defaults to
<xypath>. You are prompted whether to continue the script.
Sounds good to me.
Re: Minor scripting related wishes (a generic thread)
Posted: 24 Aug 2008 20:21
by jacky
hmm.. I don't know, I'm not sure about this one : "You passed a non-existent path to scripting command inputfile"
Because this message kinda implies the user did something, liked passed a "wrong" thing to a scripting command, and that's not really the usual way to phrase this, is it? I would think something more like "A non-existent path was used by scripting command inputfile as default location" would fit better, because the user might not have done anything, in fact possibly not even written the script...
Plus, seems more consistent with other messages such as "Script terminated by user" or "The current script appears to be recursive" I feel.
</pita>
Re: Minor scripting related wishes (a generic thread)
Posted: 25 Aug 2008 08:24
by admin
jacky wrote:hmm.. I don't know, I'm not sure about this one : "You passed a non-existent path to scripting command inputfile"
Because this message kinda implies the user did something, liked passed a "wrong" thing to a scripting command, and that's not really the usual way to phrase this, is it? I would think something more like "A non-existent path was used by scripting command inputfile as default location" would fit better, because the user might not have done anything, in fact possibly not even written the script...
Plus, seems more consistent with other messages such as "Script terminated by user" or "The current script appears to be recursive" I feel.
</pita>
There are a numner of "You..." messages in scripting:
"You must define a variable name for the scripting command...
"You passed a non-existent path to the scripting command...
"You must define a location for the scripting command...
"You must define a script file."
But okay, the others are real syntax errors... I see your point.
Re: Minor scripting related wishes (a generic thread)
Posted: 17 Dec 2009 21:09
by TheQwerty
TheQwerty wrote:Quite frankly I hate that dialog just because you can't type a path in it.
Can you please do something about this already?
Please give us an argument to add the BIF_EDIT flag to your BROWSEINFO value, or just start using BIF_USENEWUI instead of BIF_NEWDIALOGSTYLE!! I can't take this painful folder selection for keyboard users anymore!

Re: Minor scripting related wishes (a generic thread)
Posted: 19 Dec 2009 13:18
by admin
TheQwerty wrote:TheQwerty wrote:Quite frankly I hate that dialog just because you can't type a path in it.
Can you please do something about this already?
Please give us an argument to add the BIF_EDIT flag to your BROWSEINFO value, or just start using BIF_USENEWUI instead of BIF_NEWDIALOGSTYLE!! I can't take this painful folder selection for keyboard users anymore!


Take input() if you want to type...