Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

This seems like it should be very easy.  But, I'm not seeing the solution here.

 

I am creating a filemaker script that creates a variable of a list of files.  

a.jpg
b.jpg
c.jpg
d.jpg
e.jpg

 

 

I need to be able to loop through that list and do something each time.  is there a way within filemaker to specify item x of the list (similar to applescript)?

 

Solved by Christensen Design

Go to solution

Loop through a list or a found set of records?

  • Author

A list.  

 

For example, in Applescript, it would look something like this.

 

set theList to {"a.jpg", "b.jpg", "c.jpg", "d.jpg", "e.jpg"}

set theFile to item 2 of theList

theFile = "b.jpg"

 

I don't know how to extract item x from a filemaker list.

I don't think you can natively loop through a list of files. Are these files in a folder?

  • Author

They are indeed in a folder.  

 

I could write the entire script in Applescript, but I was hoping to keep it native within Filemaker, so that I can schedule the script easily on FMServer.

 

I have the Troi File Plug-in returning the files from a few different folders.  Each folder has over 10,000 files in each.  

 

I just need the ability to extract a specific list item from the list.  Then, I can iterate through the way I need to.

  • Solution

If all you are trying to do is loop through a list of items (called  'value list' in FM), try this example:

 

#Loop Test
#
Set Variable [ $theList; Value:"a.jpg¶b.jpg¶c.jpg¶d.jpg¶e.jpg" ]
#
Set Variable [ $count; Value:ValueCount ( $theList ) // get the number of items on the list ]
Set Variable [ $i; Value:1 ]
#
Loop
#
#Do something here...
If [ $i = 2 ]
Show Custom Dialog [ Title: "*** TEST ***"; Message: "Item " & $i & " on the list is: " & GetValue ( $theList ; $i ); Buttons: “OK” ]
End If
#
Exit Loop If [ $i ≥ $count ]
Set Variable [ $i; Value:$i + 1 ]
#
End Loop
#
#-- end --

 

 

  • Author

Ah, GetValue.  That's simple enough!

 

Thanks!

Hello,

 

I have a similar situation but can't figure out how to make it work depending on the specifically selected items in a checkbox set.

I want the user to be able to select which form(s) they need to print based on a value list. How do I loop through each value they have selected and print those particular forms?

 

This is what I have now (without the loop):

 

  • Perform Script [ “Allow User Abort” ]
    #
    Freeze Window
    #
    If [
    z_RESOURCES::HazardAssessmentFormList = "Interior Standard" ]
    Go to Layout [ “Print_HazardAssess_IntStandard” (z_RESOURCES) ] Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
    [ Restore; No dialog ]
    Print [
    Current record; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ]
    [ Restore: Sharp Color; No dialog ] #
    Else If [ z_RESOURCES::HazardAssessmentFormList = "Exterior Standard" ]
    Go to Layout [ “Print_HazardAssess_ExtStandard” (z_RESOURCES) ]
    Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]
    Print [ Current record; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore: Sharp Color; No dialog ]
    #
    Else If [ z_RESOURCES::HazardAssessmentFormList = "Vinyl Standard" ]
    Go to Layout [ “Print_HazardAssess_VinylStandard” (z_RESOURCES) ]
    Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]
    Print [ Current record; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore: Sharp Color; No dialog ]
    #
    Else If [ z_RESOURCES::HazardAssessmentFormList = "Non Standard" ]
    Go to Layout [ “Print_HazardAssess_NonStandard” (z_RESOURCES) ]
    Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]
    Print [ Current record; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore: Sharp Color; No dialog ]
    #
    Else If [ z_RESOURCES::HazardAssessmentFormList = "Working Alone" ]
    Go to Layout [ “Print_HazardAssess_WorkAlone” (z_RESOURCES) ]
    Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ] [ Restore; No dialog ]
    Print [ Current record; All Pages; Orientation: Landscape; Paper size: 8.5" x 11" ] [ Restore: Sharp Color; No dialog ]
    #
    End If
    Close Window
    [ Current Window ] 
  •  

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.