May 30, 20169 yr Please update your Profile to reflect the Version of FileMaker, OS and Platform you are using.
May 31, 20169 yr I dont think that the internal Id of a script is exposed anywhere. The only place i can think of is the DDR. The important thing is... what problem are you experiencing that would be solved by knowing a script ID?
May 31, 20169 yr 18 hours ago, kiwioz said: can someone help me, with a way of finding the internal script ID Given the name of a script, you can use the Design functions to work out where its name appears in the List of scripts and knowing that, deduce its scriptID - because it appears at the same level in a List of all your script IDs. Or use this calculation: Let ( [ WantedScriptName = "MyScriptName" ; // <-- the name of your script goes here AllScriptNames = ScriptNames ( "" ) ; AllScriptIDs = ScriptIDs ( "" ) ; PositionOfScript = Position ( ¶ & AllScriptNames & ¶ ; ¶ & WantedScriptName & ¶ ; 1 ; 1 ) ; Nth_Item_In_List = ValueCount (Left(AllScriptNames ; PositionOfScript)) ; ScriptID = GetValue ( AllScriptIDs ; Nth_Item_In_List ) ] ; ScriptID ) Ralph
May 31, 20169 yr Hi Ralph, That works! 18 hours ago, kiwioz said: can someone help me, with a way of finding the internal script ID This is the first time I have seen this request and I too wonder why are you need this information.
May 31, 20169 yr Hi kiwioz, Knowing the internal ID can come in handy in many situations which can eliminate possibility of indirection, thus eliminating need to hard-code. There are custom functions which are quite useful and can be used to get the internal ID of fields, layouts, etc. The attached file holds a custom function by Fabrice Nordmann. He and others have created these multi-purpose custom functions to handle your need. ScriptID.fmp12 BTW, knowing the script ID is helpful if you are testing for the current running status of another script and you do not want to hard-code the script name. Edited May 31, 20169 yr by LaRetta
May 31, 20169 yr 5 hours ago, Kris M said: The only place i can think of is the DDR. I just did a DDR on one of my files (scripts only) and don’t see this information on it. 36 minutes ago, LaRetta said: The attached file holds a custom function by Fabrice Nordmann. He and others have created these multi-purpose custom functions to handle your need Here is the link to the CF LaRetta is using, http://www.briandunning.com/cf/858 BTW, there is more to it then the Scripts ID. Worth looking at for other needs too.
May 31, 20169 yr 8 minutes ago, Lee Smith said: BTW, there is more to it then the Scripts ID. Worth looking at for other needs too. Yes, and that is why we use custom functions for the functionality ... the single CF can be used for different needs and it is quite helpful. There are links within the custom function itself, and I had also added the link within the CF itself (at the bottom) to Brian Dunning's site. Matt Petrowsky, Jeremy Bante, Dan Smith and others all have variations available from which to choose. :-)
May 31, 20169 yr Name dropper. LOL p.s. I only looked at the name of the Function and went to it. Edited May 31, 20169 yr by Lee Smith add a p.s.
May 31, 20169 yr Keep in mind, more than one script can have the same name. That may cause a problem in getting the script ID using Design functions.
June 1, 20169 yr Here is an example of why one might need the script IDs: fixing a data-separated solution. We have a dev server and a live server, and every two weeks or so we move the dev UI file to the live server. We do have to watch out for field IDs in the live vs. dev data files, we're very careful about adding new fields, but almost all scripts reside in the UI file so we tend to not think about that much. However, last month I noticed an issue with a 3rd file, our log file. When me moved our UI file from dev to live, a script in the UI file ended up pointing to an incorrect script in the log file. That is one place where FileMaker is linking things by internal ID. I used the built-in ScriptIDs ( "" ) and ScriptNames ( "" ) functions on the dev log and live log files. When I put the results together, the results looked like: 1 A 2 B 3 C in Dev, vs. in Live: 1 A 3 B 4 C So while on the surface the script names all looked the same, the result was that the file on the Dev server pointed to script (3) which was C on the Dev server, then when moved to the live server pointed to script B! To resolve this, I did something like duplicate script C twice on the dev server, and once on live. So the script ID was now 5 on both. Back in sync!
Create an account or sign in to comment