Jump to content
Server Maintenance This Week. ×

Can number of mouse clicks be counted in a script?


This topic is 6575 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi all,

I'm trying to figure out a way to imitate the behavior of the "Contact Photo" field in MS Outlook (Windows). When the field doesn't contain an image, a single-click opens the dialog for selecting an image. When the field does contain an image, a double-click is required to bring up the same dialog.

I've been trying to figure this out for a while now by timing the script from beginning to end while having a pause somewhere between that's resumed by the second click...

Is this even possible? Any ideas?

Thanks in advance for any help offerred!

Link to comment
Share on other sites

Hi Daniele,

I'm trying to avoid using anything in the interface that the end users aren't already familiar with. Use of a modifier key wouldn't offer the level of ease and intuitiveness that I'm trying to achieve. I'd probably put a labeled button next to the container before using a modifier key.

Now if my clients were all computer-savvy power users...hmmmm...:qwery:

Thanks anyway!

Link to comment
Share on other sites

I'm impressed :waytogo:

I'll tinker around with it a little to see if I can improve its performance, but I think that the time lag between 1st and 2nd clicks will be acceptable. I already swapped out a global variable for the field but I don't notice any difference.

Thanks a lot, Genx!

Link to comment
Share on other sites

It uses the new stack order of script execution...

the new script fired is executed while the first pauses (so that you had to use the "Halt Script" step)

pre 8: first IN first OUT

from 8: last IN first OUT

Link to comment
Share on other sites

Lol, yay for me, i just figured it always worked like that hehe. Yay, something new :B! Thanks for letting me know about the stack order execution.

~Genx

Link to comment
Share on other sites

Hmmm, maybe it just lagged the first time?

Or maybe if your statement about script execution first in first out is true... While the script is paused, it doesn't count as being executed so you can execute another script?

~Genx

Edited by Guest
Thought
Link to comment
Share on other sites

It's an interesting idea. I am not sure how the script stack order plays here, but in any case I thought it best to take it out of the equation altogether - see attached.

This also shortens the script, and makes it easier to understand what goes on, and why (see also the comments in the script). I've also added a field to adjust the pause, so you can actually see the action (in the 'global' version of the script).

The 'variable' version is the same, except it uses a variable instead of a global. The variable is passed to the next script via script parameter. This happens BEFORE the script is killed, so it's possible to use a local variable for this - and take the script down to 3 lines only (no reset is required).

The last version is only 2 lines, uses no globals or variables, and works in both 7 and 8.

CountClicks.fp7.zip

Link to comment
Share on other sites

Nicely done comment, i especially like the use of the script parameter, didn't even realize that would work.

I've also never really had a reason to execute multiple scripts before so i never realized the point of the current script option when defining the button. This fact alone is sure to save me some pain in the future.

Cheers,

~Genx

Link to comment
Share on other sites

I've been following this thread with interest but there is still a piece I'm missing - way back on the original post.

Kent, I can't help but wonder:

When image is empty, single-click opens the dialog for selecting an image.

When the field does contain an image, a double-click is required to bring up the same dialog.

The logic is incomplete. What if the field contains an image and is single-clicked? I only ask because Users (particularly if Windows users) are continually confused on whether to single- or double-click. I keep reminding them that single-click will work but they many times double-click anyway. I might approach this differently ... let them single-click and use an If[] test in the script to determine what to do. But even that logic fails, something like:

If [ not container ]

... open Select Image dialog

Else

... what?

End If

I think, regardless, some Users will accidently double-click when they mean single and vice-versa. And even those who are used to a sigle-click opening the Select Image dialog might get confused when there is an image and they are THEN expected to double-click. You may have plans for that single-click if container is not empty. But if a dialog must pop up, it MIGHT be more consistent to keep the keystrokes consistent as well. Just an observation.

The demos are cool. :wink2:

LaRetta

Link to comment
Share on other sites

Hi LaRetta,

If the user single-clicks on it when it's occupied it goes to that field to activate it in case the user wants to export or copy that image or anything else that can be done with a right-click/control-click.

See attached example. The only minor glitch I see with it is if a user single-clicks on an occupied field and then decides to double-click on it (before clicking out of it first), the script doesn't work because the field is behaving as a field, not a button anymore... :doah:...stupid field or button or whatever it is.

Link to comment
Share on other sites

Here's a zipped file.

FYI If you have trouble opening .sits in Windows, try Stuffit for Windows. Stuffit is the only utility I use for compression/decompression on either platform and it works great on all compressed file types that I run into (it even further compresses .jpgs).

InsertPhoto1or2ClickRev1.zip

Link to comment
Share on other sites

The only minor glitch I see with it is if a user single-clicks on an occupied field and then decides to double-click on it (before clicking out of it first), the script doesn't work because the field is behaving as a field, not a button anymore... :doah:...stupid field or button or whatever it is.

Hi Kent

this solves your problem...a simple "Commit record/request"

A second problem comes on when user press CANCEL into the dialog...but a simple "Set error capture(on)" solves it too

InsertPhoto1or2ClickRev2.zip

Link to comment
Share on other sites

...this solves your problem...a simple "Commit record/request"

Actually, it doesn't...If the record is commited the field only behaves as a button (with respect to mouse-clicking)

Link to comment
Share on other sites

Actually, it doesn't...If the record is commited the field only behaves as a button (with respect to mouse-clicking)

And wasn't that what you ask for ?

EDIT: ok, i understand...there is a problem when the container is empty

Edited by Guest
Link to comment
Share on other sites

Gee, thanks.

But there's one thing that still bothers me:

it uses the new stack order of script execution...

...

pre 8: first IN first OUT

from 8: last IN first OUT

I cannot find any reference to a change, and every test I tried seems to show it is LIFO in both versions (7.0v3 and 8.0v1, in my case). Can you please illuminate this point?

Link to comment
Share on other sites

Hi Daniele,

Remember that I wrote in my response to LaRetta,

"If the user single-clicks on it when it's occupied it goes to that field to activate it in case the user wants to export or copy that image or anything else that can be done with a right-click/control-click."

This is the desired behavior of a single-click on the field when it's occupied, therefore the field needs to behave like a field in this instance, not as a button.

I don't think there's any way for me to have my cake and eat it too on this one. (of course, I'd be delighted to have someone prove me wrong on this)

Link to comment
Share on other sites

Hi Kent, that was my concern ... they will click it once, remember it's supposed to be double ... I don't trust double-click/single click on stuff. That's just me however; I love this idea.

Michael, I'm getting inconsistent results on this process with 8.0v2. It appears that I can easily produce 1 click when double-clicking. Decreasing the duration doesn't appear to matter. A double-click on the first two breaks every 4-5 times (even without deselecting between attempts). Your third button is the most consistent but I even break it one out of every 6-7 attempts (if I deselect between attempts). The first button (global) breaks the most often.

Maybe I just double-click too fast - this is the speed I always double-click something. If I'm a fast double-clicker others might be as well. Just an observation. This is a great thread! :wink2:

Link to comment
Share on other sites

?? Clicking faster than FM can compute? That's why I made the pause adjustable - so you can click slowly. Surely, it doesn't break when you click slowly?

FWIW, it works for me fine at about 0.7 sec - but I suspect this would vary from computer to computer, and certainly from user to user.

Link to comment
Share on other sites

I see. Well I have duration on .1. No, it doesn't break when I click very slowly. :wink2:

And maybe I have my system click-rate set high as well. Or maybe I drink too much coffee. :crazy2:

Link to comment
Share on other sites

...that was my concern ... they will click it once' date=' remember it's supposed to be double ... I don't trust double-click/single click on stuff.[/quote']

Yeah, I've been putting more thought into the issue since you raised it and I'm beginning to wonder if a dialog box appearing on 1-click may be the "best" solution. I'll bring that up to my client. Ultimately though, the best solution is the one the client is the most happy with :B

My typical double-click speed is consistently interpreted as a single-click in every solution offered, so I've had to slow down just a hair to get a double-click to register. I don't see this as being much of a problem for the typical user, though.

Link to comment
Share on other sites

But instead of feeling that I must be just very different than everyone else, I should clarify that the tests were the same no matter the duration setting. The consistency in break remained the same when I clicked at my normal speed.

I don't think the duration setting affects faster clicking once the user has a click rate that falls within the duration. The duration can only compensate for those clicking slower than the duration time.

Link to comment
Share on other sites

This topic is 6575 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.