# Dev Tool to Go to Layout by LayoutID

**URL:** <https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704>\
**Category:** Lounge (Discussions)\
**Created:** [January 22, 2020, 10:10pm UTC](https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704 "2020-01-22T22:10:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [January 22, 2020, 10:10pm UTC](https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704/1 "2020-01-22T22:10:57Z")

</div>

Here is a “Fun FileMaker Fact” beta…a (macOS only) tool to go to Layout by LayoutID.

![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/1X/72f98f50d63ce7affab36a4bbccd0a04b8a91264.png)

Here is the AppleScript...

**tell**  **me**  **to**  **activate**  
**display dialog**"Layout ID?" default answer "Enter Layout ID" buttons {"OK", "Cancel"} default button "OK"  
**set** layout\_id **to**  **the** text returned **of** result  
-- set layout\_id to layout\_id as integer  
**tell** _application_ "FileMaker Pro Advanced"  
**go to** _layout_ _ID_ layout\_id  
**end**  **tell**

You will need to check the "Allow Apple events…" Extended Privilege.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/4/4f8c35e132c83f826fe996a908bbf4d39c22b3c0.png)

---

<div class="post-metadata">

**Author:** ![mrwatson-de](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/mrwatson-de/32/351_2.png) [@mrwatson-de](https://the.fmsoup.org/u/mrwatson-de)\
**Post date:** [December 6, 2020, 9:46pm UTC](https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704/2 "2020-12-06T21:46:51Z")

</div>

I don’t understand why you want to use AppleScript for this when FM has everything you need!?

Go to Record [By number: ValueCount( Left ( LayoutIDs(“”) ; Position( “¶“ & LayoutIDs(“”) & “¶” ; “¶“ & $LayoutID & “¶” ; 1 ; 1 ) ) )]

(Posted on an iPhone - Calculation may not be 💯%! - but it’s the idea that counts!)

Not to mention of course that I’m not sure _why_ you’d want to do this!

---

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [December 6, 2020, 10:17pm UTC](https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704/3 "2020-12-06T22:17:03Z")

</div>

We often do clean-up work on multi-file solutions built by others...where we are removing unused Layouts, Scripts, etc.

Rather than add a FileMaker Script to each File, we simply run the AppleScript from the AppleScript menu and it works on the frontmost File.

The LayoutID comes from MBS Plugin or a DDR tool.

On the other hand, sometimes we do add a FileMaker Script to each File that we call with an FMP URL that takes us to the File, Layout, and Record(s)

Different approaches for different use cases. Both good.

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [December 6, 2020, 10:21pm UTC](https://the.fmsoup.org/t/dev-tool-to-go-to-layout-by-layoutid/704/4 "2020-12-06T22:21:36Z")

</div>

Fun!

I'm wondering about the use case too.

My standard library of custom functions includes GetLayoutNumber(layoutID). Internally it looks a lot like the code you posted. It didn't get much use until recently.

I'm playing with a webviewer navigation tool that uses the filemaker/javascript integration. It passes Layout or Script IDs to a script which then uses the CF to decide which layout to display. This is a case which would not work with Layout/Script names ( not unique ). Nor would it work with Layout/Script number ( subject to change ), so the use of ID is necessary.

Even so, I don't want to use AppleScript to resolve the problem. 😛
