Jump to content
Server Maintenance This Week. ×

Using tooltip (or ObjectName) as a script value?


wedgeman

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

Recommended Posts

Use Case:  I've got a graphic (in this instance, a complete human body).

I want to mouse-over and click on say, the hand, and have that trigger a script, with a parameter.

I'd hope to simply have a single script, read the parameter (which would in fact grab the value of the tooltip), and have that passed into the script.

It seems to me that the various flavors of "get(objectname), etc don't seem to have a way to grab the actual text that's in the "tooltip" or "object name".

Am I missing something in there?

I'd love to be able to create 50 graphics, name each one by tooltip (or object name), and not have to create/modify a script for each and every single graphic.

thanks for any help!

 

EDIT:  as a temp work-around, I've manually dropped the objectname into the script parameter, then have the script punch that into appropriate fields.. It's annoying to set up, and takes 5x's as long, but that's currently the only method I've got for this. 

Any further options?

Edited by wedgeman
Link to comment
Share on other sites

Hi wedgeman,

Is this a Graphic of Human Body with 50 points of interest,  each having a tool tip and and if clicked on would set a script parameter to have the script do something like create a new related record?
or

50 graphs each having a part of the of the human body using a script parameter?

Or

have I missed the point of your question?

Lee

Link to comment
Share on other sites

Yes.... this is a graphic of a human body (medical db for a specific sub-field). imagine a stickman... we've created a clear object which overlays the hand, another over the wrist, the arm, elbow, shoulder, thorax, etc... ~50 such on the front,a nd another ~50 on the rear image...  then there's the second gender.....  so, 200 objects.... :D

the use case is that when the user mouses/hovers over say, the left wrist, he sees a tooltip, saying 'left wrist' (in his language).

The click would then pass "left wrist" or "male left wrist" into a single script (which is able to parse where to take it and what to do with it)...

The issue is that we can't seem to get "wrist" (either tool tip OR the Object Name) to pass properly into ANY script on click... 

GetLayoutObjectAttribute seems to require a name - but we need to capture the name..

Our hope was to create only a single object, prepare it, then duplicate it, and have to change only the location and objectname (or object tooltip), in order for the script to capture that value for use in scripts.

 

But it seems that our only found method is to 1. modify the item and tool tip, and 2. click into the button setup, and modify the "script parameter), then pass it on into the actual script.. As this process will be replicated 200x's for adults and another 200x for children, we'd really like to avoid the mind-numbing part of bumping thru EVERY SINGLE SCRIPT PARAMETER....

Am I looking at this incorrectly?  I've intermittently dug around the interwebz for the better part of several days, and have yet to find a method to convert either the objectname or the tooltip of a given object into a script when one clicks on that object/button...

malebod.jpg

Edited by wedgeman
Link to comment
Share on other sites

I don't see a shortcut. I don't understand why you don't just use Get(ScriptParameter). 

If you have to name every object, and create every tooltip, what's wrong with using Get(ScriptParameter)?

You're duplicating the object.  Double click on button setup and change the parameter.

Link to comment
Share on other sites

that's what I was afraid of... its a total of ~800 additional steps, to change the scriptParameter for each and every object...

it would makea lot of sense if one could simply Get(ObjectAttribute:Name), and pass that into a script....

Link to comment
Share on other sites

Well, here is one way but it will mean you must change your tooltip.  I used fields but theory is the same.  Your tooltip sets a global variable and your script reads that global variable when you fire the script.  In this way, you don't need to add both a tooltip AND a script parameter but you'll still need to change every tooltip that you've already written.

 

 

 

tooltip.fmp12

Edited by LaRetta
  • Like 1
Link to comment
Share on other sites

By the way, because this uses Refresh Window, it should be used on a light layout.  For example, you can have a table with no records and just your image.  In that way, it wouldn't be intensive to use.  

Link to comment
Share on other sites

Thanks - that is perfect!

just to confirm:    Basically, i'm creating the global variable in the process of 'showing' the tooltip, by only changing the name in the tooltip, then the script grabs the variable for use later..

I love it!

 

thanks!!!

Link to comment
Share on other sites

Yes, that will be it.  You might wish to clear $$current at the end of your script.  I'm unsure how you're using it but I'm confident you'll figure that part out.  It'll take some work to change all your existing tooltips but at least you don't risk mistyping the name in two places.

Link to comment
Share on other sites

13 hours ago, Steve Martino said:

what's wrong with using Get(ScriptParameter)?

I know, right?  It would be nice if it worked to have the tooltip simply be Get ( ScriptParameter ) but it seems the value remains empty until the script is fired which is ... of course ... the horse ahead of the cart.  ;)

Edited by LaRetta
Link to comment
Share on other sites

21 minutes ago, wedgeman said:

mitigating possible errors is a big part, when the repetition amount is so high...

Yes, and I also should mention, for others reading even if not your situation ... hard-coding values normally isn't a good approach.  If those names will be used as record data or elsewhere, it might be worth it to store the part names in a table with only a unique auto-enter serial number and referencing its text from the relationship in the tooltip instead.

Anyway, I can tend to overthink but I thought it good to mention the dangers of hard-coding values.  I envisioned this might be the only place you would need to change the name but if the scientists decided that a cuello should really be properly named a cou and you had used cuello all through your solution, it would require a substantial cleanup whereas if the parts were in a table, you would just change it in one place and use its Serial all through your solution.

  • Like 1
Link to comment
Share on other sites

4 hours ago, LaRetta said:

Your tooltip sets a global variable and your script reads that global variable when you fire the script.

This is very cool. I didn't think it would work well because of the tooltip delay, but it does!

 

Nevertheless:

13 hours ago, wedgeman said:

this is a graphic of a human body (medical db for a specific sub-field). imagine a stickman... we've created a clear object which overlays the hand, another over the wrist, the arm, elbow, shoulder, thorax, etc... ~50 such on the front,a nd another ~50 on the rear image...  then there's the second gender.....  so, 200 objects....

This is something that might be easier to implement in a web viewer, I think. 

 

Link to comment
Share on other sites

Odd.  Last nite my post had links, this morning they are missing. Anyway, maybe these will help

http://www.troi.com/products/activatorplugin/

https://www.teamdf.com/blogs/a-sliding-drawer-that-opens-and-closes-on-mouse-over/

https://baseelementsplugin.zendesk.com/hc/en-us/articles/115002990887-BaseElements-Plugin

9 hours ago, LaRetta said:

Well, here is one way but it will mean you must change your tooltip.  I used fields but theory is the same.  Your tooltip sets a global variable and your script reads that global variable when you fire the script.  In this way, you don't need to add both a tooltip AND a script parameter but you'll still need to change every tooltip that you've already written.

 

 

 

tooltip.fmp12

Pretty cool @LaRetta.  Although I don't have a use for it currently, I'll keep it for future use. 

Link to comment
Share on other sites

 

14 hours ago, LaRetta said:

By the way, because this uses Refresh Window, it should be used on a light layout.  

It was pointed out by Comment that we don't even need that Refresh Window[] in the script at all!  It did when I first created it but now it works fine without it!  That is even better news!  Thanks, Michael!  :smile3:

Link to comment
Share on other sites

@LaRetta, do you think it's possible/practical to make the picture in a web viewer? Then use JS, with a mouse over event to show a tooltip and call a script.  I remember seeing this somewhere in a blog, probably related to mapping, but couldn't find it.

At the very least you could style a better tooltip.  

Edited by Steve Martino
Typo
Link to comment
Share on other sites

Absolutely flawless implimentation for the client on this recommendation.. many thanks.

We were able to meet with the medical reference team for 2 hours last night, and because we could update this with a simple modification of only tooltips, we were able to make all modifications on-site, verify with them in their language, and even fixed additional components.. wouldn't have been possible without this tooltip value script - we wouldn' t have had the time to pull it off..  in 2hrs, we went from 1 human body correct to all 4 forms (2 adult, 2 child) - well over 400 total reference points...

Thanks a million!!

Edited by wedgeman
Link to comment
Share on other sites

This topic is 2484 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.