4 Replies Latest reply on Feb 29, 2016 6:12 AM by tays01s

    Syntax translation

    tays01s

      I need to understand the following syntax in order to manipulate it. Is there short 'duffers guide' out there?

       

       

      If [ Abs( Get( SystemPlatform )) -1 /*Windows*/ ]

      Set Variable [ $folderPath; Value:Substitute ( "/" & $path; ["//"; ""]; ["/"; "\\"]) ]

      Send Event [ open document; "cmd.exe /C MKDIR " & Quote( $folderPath & $folder & "/" & $subfolder & "\\"); Application Name: “<unknown>” ]
      [ Wait for completion ]

      Set Variable [ $errorFolder; Value:Get( LastError) ]

      Else

      #Create on Mac

      Perform AppleScript [ Calculated AppleScript: "set theOutputFolderPath to path to " & "desktop" & " folder" & ¶ & "set theNewFolderName to " & Quote( $folder) & ¶ &
      "tell application \"Finder\" " &¶ &
      "if (exists folder (theOutputFolderPath & theNewFolderName as string)) = false then make new folder at theOutputFolderPath with properties {name:theNewFolderName} " & ¶ & "end tell" ]

      End If

       

        • 1. Re: Syntax translation
          Markus Schneider

          there is a really smart app for functions, script-commands, etc - Addendum, available from the iOS AppStore or via developer's homepage (google for addendum filemaker). It also translates between languages

           

          as for Your script, it seems to be a call to the operating system that creates a folder - therefore it's OS scripting.. it sets the folderpath according to the OS and creates that folder using AppleScript (OSX) or commands on Win. Get (SystemPlatform) gets the OS variant, depending on that, the script executes specific commands

          • 2. Re: Syntax translation
            tays01s

            Thanks Markus,

            I don't have an iOS device; is there an OSX app that does similar?

             

            I get the gist of the script, but need to understand details to make it work with the rest of what I intend.

            • 3. Re: Syntax translation
              wimdecorte

              what kind of details are you not understanding?  The OS script part of it (command line syntax on Windows and AppleScript syntax on Mac?)

               

              Maybe start with saying what you need to change to the script?

              • 4. Re: Syntax translation
                tays01s

                Good point, though I'd like to learn a bit syntax anyway.

                 

                So, aside from making a folder, I need to get the full filepath onto which I add the export files & and export them. Main thing is:

                1. Get a full folder path: Previously I had:

                 

                If [ $Device = 1 ]

                Set Variable [ $Filepath; Value:Get (DesktopPath)&"FC_export files/" ]

                Else If [ $Device = 2 ]

                I'm not sure what the PC version would be.

                End If


                2. Then I need to extend the filepath with the export filename: Latterly:

                Set Variable [ $ex_patient; Value:$filepath&"Export_patient.fmp12" ]

                3. Finally export the file which I assume can stay as I had it: Eg.

                If [ Patient::Export_record = 1 ]

                Export Records [ File Name: “$ex_patient”; Character Set: “Unicode (UTF-16)”; Field Order: Patient::__uuID

                Patient::Biochem_n

                 

                 

                Patient::Biochem_min_max_n

                 

                End if