1 Reply Latest reply on Mar 12, 2014 3:56 PM by pfroelicher

    export container fields, create a folder macos, write into it...

    pfroelicher

      I need to export container fields to a folder on the desktop of the user.

      Nowadays I have a script that loops through my records and does the "export field content" .

      When I start the script, I define the new folder and its location and then press "enter" for each record.

      However I would like to automatise this.

      My script would do something like this:

      Check you're on the right layout

      Execute Applescript : check if the folder nfe_export is created on desktop...if not create it

      go to first record

      Export field content, path Get(DesktopPath)/nfe_export/

      Go next, exit after last

       

      my existing script, which needs a manual input for the first record, where I create the folder looks like this.

       

      I think most elegantly I would use Applescript to A: Create a folder on the desktop B: pull the content of the container fields.

       

      Any suggestion

       

      Ir para registro/solicitação/página

      [ Primeiro ]

      Definir variável [ $caminho; Valor:Get ( DesktopPath ) & "/" & "nfe_export"&"/" ]

      Realizar AppleScript [ AppleScript nativo: tell application "Finder" activate

      make new folder at folder "Desktop" of folder "pfroelicher" of folder "Users" of startup disk with properties {name:"nfe_export"} end tell

      ]

      Loop

      Exportar conteúdo do campo [ PC::pc_danfe_pdf; “file:$caminho” ]

      Exportar conteúdo do campo [ PC::pc_danfe_xml; “file:$caminho” ]

      Ir para registro/solicitação/página

      [ Próximo; Sair depois do último ] End Loop

       

        • 1. Re: export container fields, create a folder macos, write into it...
          pfroelicher

          Ok...I got it 90%.

          Now I just would need a script that checks if on windows or mac, checks if folder nfe_export exists, if not creates a folder on the desktop called nfe_export

           

          My script looks like this and I have to have a folder manually created in /Users/Nameofuser/Desktop called nfe_export .

          Which is not very elegant... but already much better that hitting "enter" a zillion times...:-)

           

           

          Ir para registro/solicitação/página

          [ Primeiro ]
          Definir variável [ $caminho; Valor:Choose ( Abs ( Get ( SystemPlatform ) ) -1 ;

          /*MAC OS X*/

          Get ( DesktopPath ) & "nfe_export/" ;

          /*WINDOWS*/

          "filewin:"& Get ( DesktopPath ) & "nfe_export/" )]

          Loop

          Definir variável [ $nomepdf; Valor:$caminho&Substitute(GetValue(PC::pc_danfe_pdf;1);"remote:";"") ]

          Definir variável [ $nomexml; Valor:$caminho&Substitute(GetValue(PC::pc_danfe_xml;1);"remote:";"") ]

          Exportar conteúdo do campo [ PC::pc_danfe_pdf; “$nomepdf” ]

          Exportar conteúdo do campo [ PC::pc_danfe_xml; “$nomexml” ]

          Ir para registro/solicitação/página

          [ Próximo; Sair depois do último ] End Loop

           

           

          I found a great script in this link http://forums.filemaker.com/posts/3b7423bf8d

          However could not implement it due to lack of applescript.

          Anyone... Sorry it is all in portuguese... but I am in Brazil.