File Mover Blog

  • 22 May

    Manage the rule status change with the help of Pascal Script

    Q: We would like to manage the rule status change : turn HOLD, turn Release, etc. I didn’t find any “ps” command related to this need. Could you help us to stop/hold/enable status rules? Just missing this PS command to change rule status 😉

    Hope it exists…. based on type “psRuleChangeStatus( RuleID : Integer, newStatus : String/Integer… )” or something like that…
    A: In our latest version v2022.5.22.0 we added two new functions that will help you.
    ===============================================
    – Use psRuleSetHoldStatus to set the status of moving rule to HOLD. The RuleId can be found in the statusbar information.Function psRuleSetHoldStatus(_RuleId: Integer): Boolean;

    i.e. psRuleSetHoldStatus(1);
    ===============================================
    – Use psRuleSetReleaseStatus to set the status of moving rule to RELEASE. The RuleId can be found in the statusbar information.

    Function psRuleSetReleaseStatus(_RuleId: Integer): Boolean;

    i.e. psRuleSetReleaseStatus(1);
    ===============================================

    FYI: In this version we also added some new Pascal Script var that can be used for example in the ‘On Destination’ and ‘On Destinations’ Pascal Script options.
    • psFileDir
    • psFileSubDir
    • psFileSubDirFirst
    • psFileSubDirLast
    • psFilePath
    • psFileSubPath
    • psFileSubPathFirst
    • psFileSubPathLast
    Example:
    • WIN as Source, Root Path is C:\Scan\
    • During scan the following file was found: C:\Scan\Sub1\Sub2\Intro.pdf
    Result when using the new Pascal Script var will be:
    • psFileDir > C:\Scan\Sub1\Sub2
    • psFileSubDir > Sub1\Sub2
    • psFileSubDirFirst > Sub1
    • psFileSubDirLast > Sub2
    • psFilePath  > C:\Scan\Sub1\Sub2\
    • psFileSubPath > Sub1\Sub2\
    • psFileSubPathFirst > Sub1\
    • psFileSubPathLast > Sub2\

    #Filetransfer #PascalScript

    If you need any info about this ‘Manage the rule status change’ request, please let us know.

    Best regards,

    Limagito Team

  • 08 May

    Sending emails using GMail SMTP with OAuth2 authentication – OOB

    Q: Sending emails using GMail SMTP with OAuth2 authentication. I am trying to set up an outgoing email notification that will happen when a file moves to it’s destination.

    8th of May 2022, we are working on an update because of: OAuth out-of-band (oob) flow will be deprecated

    Instead of the Google URI urn:ietf:wg:oauth:2.0:oob you’ll have to use a loopback (IP) address as Redirect URI like http://127.0.0.1 or http://localhost

    Starting from version v2022.5.8.0 a redirect port will be added to the OAuth2 setup which is only needed during the OAuth2 verification setup.

     

    A: Yes this is possible.

    First check if you enabled the GMail API in your account: https://support.google.com/googleapi/answer/6158841?hl=en

    Secondly we’ll need credentials ‘Client ID and Client Secret’  for the OAuth2 authentication: https://support.google.com/googleapi/answer/6158857?hl=en&ref_topic=7013279

    We added some screenshots to help you with the setup.

    Limagito File Mover SMTP Setup

    Don’t forget the Security Options:

    Limagito File Mover SMTP Setup

    OAuth2 Setup:

    OAuth out-of-band (oob) flow will be deprecated
    Please add the following information:
    – Authorization Endpoint URL: https://accounts.google.com/o/oauth2/v2/auth
    – Token Endpoint URL: https://www.googleapis.com/oauth2/v4/token
    – Client ID
    – Client Secret
    – Scope: https://mail.google.com/
    – Redirect URI: http://127.0.0.1
    – Redirect Port: 3017 (can be any other port that is not in use)
    Click GET and your browser will open. Please follow the steps in your browser and after acceptance we will automatically fill in Refresh Token and Access Token. Do not forget to <Save> afterwards.

    Limagito File Mobver GMail SMTP with OAuth2

    RunTime Log Result when testing:

    8/05/2022 17:54:07 OAuth2 Authorization Successful
    8/05/2022 17:54:09 Send Success C:\Test\In\IntroXFM.pdf to smtp.gmail.com;1356113
    8/05/2022 17:54:09 ************************************************************
    8/05/2022 17:54:09 Rule Start Time: 8/05/2022 17:54:07
    8/05/2022 17:54:09 Rule End Time: 8/05/2022 17:54:09
    8/05/2022 17:54:09 Total Files Successful, Count: 1 & Size: 1356113
    8/05/2022 17:54:09 ************************************************************

    #FileTransfer

    If you need any info about this ‘GMail SMTP with OAuth2’ question, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Google OAuth2 SMTP , , ,
  • 05 May

    Check pdf pagewidth in order to move files to a different folder

    Q: A big help would also be a width check. If pdf width > 300 mm move to another folder. Then I could use some system tools on the pdf.

    A: In version v2022.5.5.0 we added some Pascal Script function to achieve this.

    -First we added two WIN destinations.

    • Destination with ID1 should contain the pdf files with a width <= 300 points
    • Destination with ID2 should contain the pdf files with a width > 300 points

    Limagito File Mover multiple Windows destinations

    -Next you’ll some Pascal Script

    Limagito FileMover Pascal Script option

    -Please Add and Enable ‘On Destinations

    Var
      tmpCount: Integer;
      tmpHeight, tmpWidth: Double;
      tmpFile: String;
    Const
      ctMaxWidth = 300;  
    Begin
      psExitCode:= -1;
      // ... add your code here
      tmpFile := psFilePath + psFileName;
      If psPdfGetPageCount(tmpFile, '', tmpCount) Then
        psLogWrite(1, '', 'Page Count of ' + tmpFile +' : ' + IntToStr(tmpCount));
      If psPdfGetPageHeight(psFilePath+psFileName, '', 1, tmpHeight) Then
        psLogWrite(1, '', 'Page Height of ' + tmpFile + ' : ' + FloatToStr(tmpHeight));
      If psPdfGetPageWidth(psFilePath+psFileName, '', 1, tmpWidth) Then
      Begin
        psLogWrite(1, '', 'Page Width of ' + tmpFile + ' : ' + FloatToStr(tmpWidth));
        // Check Width
        // Pdf Files <= ctMaxWidth should go to DestinationID 1 
        // Pdf Files > ctMaxWidth should go to DestinationID 2    
        If (psDestinationID = 'ID1') And (tmpWidth <= ctMaxWidth) Then psExitCode := 1; 
        If (psDestinationID = 'ID2') And (tmpWidth > ctMaxWidth) Then psExitCode := 1;  
      End
      Else
      begin
        // Error Loading Pdf File, set psExitCode to 0
        psExitCode := 0;
      End;   
    End.
    

    Limagito File Mover Pascal Script

    – RunTime Log Result:

    Limagito File Mover RunTime Log result

    #Filetransfer #PDF

    If you need any info about this ‘Check pdf pagewidth’ option, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script PDF ,
1 53 54 55 56 57 58 59 145
SEARCH