Aa6...: My devices are Android 13 (Phone) and 14 (tablet). Did not tried your scripts, I understand them and i use this type since the button field.
Ernst: Procedures can be writen strait forward or build with reusable functions... When using functions, they can be in JS field or in the Shared script or in github or the attached libraries.
It is mostly about checking the conditions and formating, and, I agree, they are different from the Action or Trigers, where it is more about manipulating data ... The advantage of scripts is that they are compiled and therefore faster. The use of shared functions also simplifies develop, debuging and maintenance.
My tipical function is:
function formatDate(dt,f){
if( field(dt)==null) return "insert start date"
return moment(field(dt)).format(f==null ?"D.M.YY" :f)
}
here i set default format and calling is simple :
formatDate("start")
Some checking about dt value can be included.
Such function is a good candidate to be in shared script instead in two or more js Fields.
So, gpt(MS Copilot) says that shared scripts functions can be used in javascript field. But in my case it don't work. I tried calling with
scriptName.functName() or just functName()
Regards