Ian Slater Posted July 1, 2022 Posted July 1, 2022 using FMP for a long time, but I am a rank amateur. I have a DB of a TV script pdf . on each page there is a page number and the individual scene numbers. It has a page number field and a portal to put the scene numbers in text on the page. The portal is from a table that has 2 fields, the scene numbers and the page number. the page number is used to create the relationship. I want to create a script or calculation for when a scene number is typed in, the tv script goes to the page with that scene on it. the steps are 1. on the script page type the scene number you want to go to 2. that input would be used to go to the 2 field table and where the scene number matches, it would get the page number from this table 3. take that page number result and navigate to that page number in the tv script document. if anyone could suggest what functions I need... thanks Ian
comment Posted July 1, 2022 Posted July 1, 2022 For the purposes of sanity, let's give your tables names, say Pages for the parent table and Scenes for the child table. You can navigate to a Page record that is the parent of Scene X directly by performing a find. For example, a script like: Enter Find Mode[] Go to Layout [ Pages ] Set Field [ Scenes::SceneNumber ; SomeTable::gSearchValue ] Perform Find would find the page that contains the scene number entered into a global gSearchValue field (which can be in any table). However, this would replace your existing found set in the Pages table. If you only want to move to the target record within the current found set, you would need to loop until: not IsEmpty ( FilterValues ( SomeTable::gSearchValue ; List ( Scenes::SceneNumber ) ) ) returns True. And of course, it would fail if the target record is not in the current found set.
Ian Slater Posted July 2, 2022 Author Posted July 2, 2022 Thanks for your generous help. I assume the loop comes after the perform find. Never have done a loop but i will have a go. Many thanks again.
comment Posted July 2, 2022 Posted July 2, 2022 21 minutes ago, Ian Slater said: I assume the loop comes after the perform find. No. If you perform a find, then there is no need to loop. The find will create a found set of one record only.
bcooney Posted July 3, 2022 Posted July 3, 2022 I question the use of FileMaker for this. Seems like you’re searching a script for a scene number. Couldn’t that be accomplished in a pdf viewer?
Ian Slater Posted July 3, 2022 Author Posted July 3, 2022 Its something more than a simple script document . It is called a lined script for use in tv and film editing. It has another table of facing pages which describe the individual shots that make up a program. I use a one to many relationship to put these facing pages in line with the script. I am making progress with Comments suggestion. I never used a global field. I can see how powerful it is combined with a script trigger. (spoken like a true amateur)
Ian Slater Posted July 3, 2022 Author Posted July 3, 2022 (edited) one other question about approach. The filter-- which is a calculation, not IsEmpty ( FilterValues ( SomeTable::gSearchValue ; List ( Scenes::SceneNumber ) ) ) is working ...It is returning a value of 1 in the global field where I want it. Is there a way to just go to that record in the table I want? Or can I only achieve this by a loop? Edited July 3, 2022 by Ian Slater
comment Posted July 3, 2022 Posted July 3, 2022 3 minutes ago, Ian Slater said: Is there a way to just go to that record in the table I want? Not directly, because there is no way to identify the page record you want by the value of one of its children's scene number. A parent stores no data about its children; it's only the child that "knows" it parent's key. If you prefer, you could perform the find in the Scenes table, and then use the Go to Related Record script step to "go directly" to the parent Page record of the found scene.
Ian Slater Posted July 5, 2022 Author Posted July 5, 2022 both tables have the page number. I have them set in a relationship table. The page number from the child works correctly when I put it in the parent table, but the filter, a calculation field which shows "1" in the correct record in the child, based a global , only shows "0" when I put it in the parent... oh so close....
comment Posted July 5, 2022 Posted July 5, 2022 54 minutes ago, Ian Slater said: both tables have the page number. Well, yes - but you want to start by entering the scene number, not the page number, right? So the question is how to map the entered scene number to the corresponding page number. 59 minutes ago, Ian Slater said: oh so close.... Perhaps you should explain in more detail the scenario you are struggling with. Seemingly, this is a trivial task: you know the number of the scene, and the scene record with that number has the page number you want.
Ian Slater Posted July 6, 2022 Author Posted July 6, 2022 Thanks for the reply. The DB has 2 related tables. They are PDFs . "Pages" and "scenes". I want to be able to on the "pages" table type a scene number and jump to the page record that contains that scene number. I have constructed a table that works as a table of contents. So when you enter the scene number in the global scene field, no matter what page you are on, it would go to the page with that scene number. in the attached table which is the toc, sc 18 is entered in the global scene field. using your suggestion a true value is calculated in the scene filter field. Scene 18 is on page 6. But i do not know how to move to page 6 in the table "pages".
comment Posted July 6, 2022 Posted July 6, 2022 2 hours ago, Ian Slater said: I want to be able to on the "pages" table type a scene number and jump to the page record that contains that scene number. So what objection do you have to the very first suggestion I made: perform a find in a layout of the Pages table, searching the related scene number field. All you need for this is a global field in which to type the scene number and the script shown in my first answer above. (In fact, even the global field could be replaced by a custom dialog within the script - but that may not be the most convenient user interface.)
Ian Slater Posted July 6, 2022 Author Posted July 6, 2022 i need all the records not just the found one
comment Posted July 6, 2022 Posted July 6, 2022 39 minutes ago, Ian Slater said: i need all the records not just the found one Then add the Show All Records step at the end of the script. The found set will include all page records, but you will still be on the one page record that was found.
Ian Slater Posted July 9, 2022 Author Posted July 9, 2022 thanks for your help. I got it working. Needed a few bits from around the web. I am pleased with the solution.
Recommended Posts
This topic is 937 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 accountSign in
Already have an account? Sign in here.
Sign In Now