Jump to content
wedgeman

Using tooltip (or ObjectName) as a script value?

Recommended Posts

wedgeman    0
Posted (edited)

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

Share this post


Link to post
Share on other sites
Lee Smith    145

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

Share this post


Link to post
Share on other sites
wedgeman    0
Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
wedgeman    0

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....

Share this post


Link to post
Share on other sites
LaRetta    478
Posted (edited)

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

Share this post


Link to post
Share on other sites
LaRetta    478

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.  

Share this post


Link to post
Share on other sites
wedgeman    0

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!!!

Share this post


Link to post
Share on other sites
LaRetta    478

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.

Share this post


Link to post
Share on other sites
wedgeman    0

perfect..

 

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

Share this post


Link to post
Share on other sites
LaRetta    478
Posted (edited)
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

Share this post


Link to post
Share on other sites
LaRetta    478
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

Share this post


Link to post
Share on other sites
comment    1,372
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. 

 

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites
LaRetta    478

 

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:

Share this post


Link to post
Share on other sites
Posted (edited)

@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

Share this post


Link to post
Share on other sites
LaRetta    478

Give it a try, Steve ... I won't have time to do it.  As Comment has indicated, web viewer might be better approach. :-)

Share this post


Link to post
Share on other sites
wedgeman    0

That seems feasible, IMO.. won't work for my usage (web), but could work..

Share this post


Link to post
Share on other sites
13 hours ago, LaRetta said:

...As Comment has indicated, web viewer might be better approach. :-)

I missed that...

Share this post


Link to post
Share on other sites
wedgeman    0
Posted (edited)

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

Share this post


Link to post
Share on other sites

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


  • Similar Content

    • By NewBoard
      I have a database, which has two printable forms. One has been designed in portrait, and the other in landscape. Both of them are only ever printed using buttons tied to script steps, never manually. I was hoping that there would be some way to specify orientation via the script. However, after some poking around of my own and light Google searching I am thinking this may not be so easy.

      I am able to go into Print setup to change the orientation just fine, however this sets it for the entire database which is not all around helpful. While specifying the options in the print step, I am able to change orientation. For some reason though, this changes the default orientation across the entire database. Not even while running the script, but just specifying it in the options of the script step. So now I'm at a loss.
      If this is not able to be done, redesigning one of the forms wouldn't be that difficult. But if there's a way to do what I'm trying to do, any assistance would be greatly appreciated!
    • By NewBoard
      I currently have a form that contains a portal. In the portal there is a value that will either be "Accepted" or "Rejected". I'm wondering if there's a way to parse through this table to check if any related values have a "Rejected" or if they are all "Accepted". Then using that outcome, decide if the form should display Rejected or Accepted.
      Please let me know if I need to provide any more information and/or images.
      Thanks in advance for any assistance you can offer!
    • By Quito
      Hi,
      I want to create a Dropdown List of numeric options to select a range of records.  For example, the Dropdown list would contain:
      5
      10
      20
      50
      100
      -------
      edit...
      Each option would select the next 5;10;20;50 or 100 records to the right.  A Checkbox would be populated (with an X) in the selected number of contiguous records; Then, a Find Selected Checkboxes would return the selected records.  The contiguous selection should be independent of whatever the current state of Found (Sorted/Unsorted) is.
      Any help will be gratefully acknowledged.
      Best,
      Daniel
       
    • By wojeezy08
      My end goal is to have a button that, when clicked:
      1. Opens a pdf form from my server
      2. Fills in the form using data entered into FileMaker (I'm using FileMaker 10)
       
      I'm on step one and and trying to use the "Open File" script, however it's not working.  Can the "Open File" script be used to open non-Filemaker files, such as PDFs?
       
       
    • By jbante
      FileMaker 16 introduced a collection of built-in functions for manipulating data serialized as JSON. This makes it easier for FileMaker applications to interact with many web services. This will also make JSON the de facto standard format for scripts within FileMaker to pass parameters and results to each other, improving code sharing within the FileMaker community.
      JSON does not have a broad palette of scalar data types to choose from: text, number, boolean, and null. Even with those, FileMaker's JSONGetElement function always returns a text result, even when the serialized JSON value is a number or boolean. So I made a handful of custom functions and scripts for sending and receiving typed data with JSON.
      The module is hosted on GitHub, or you can download it directly.
×

Important Information

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