File Mover Blog

  • 14 Apr

    How to include pdf page count next to the filename after moving

    Q: Could you assist, can I include a PDF page count next to the filename after moving PDFS in my Rule Events email notification. Also a total number of files. Thank you for your time.

    A: Yes this is posible using some Pascal Script.

    • We used a Windows folder as Source

    limagito file mover windows folder as source

    • File Filter Setup:
      • We only want to move pdf files ( *.pdf )

    limagito file mover file name include filter

    • Pascal Script Setup:

    limagito file mover pascal script

      • Enable and add the following ‘On Rule Begin’ script:  link
        • psVIA := 0; will set the Integer parameter %VIA to zero
        • psVSA := ”; will clear the String parameter %VSA

    limagito file mover include pdf page count

    • Rule Events Setup:

    limagito file mover rule events

      • Enable ‘On Success’ event and enable ‘Enable Mail’
      • In the Mail setup we’ll use the parameters %VSA and %VIA
        • %VSA will contact the filename and page count
        • %VIA will contain the total number of files

    limagito file mover rule events email setup

      • Don’t forget to enable ‘Trigger mail event after scan’ because we want a single email ofter the move is done:

    limagito file mover rule events options

    • Function Setup:
      • Enable ‘Exit Cyclus on Error’ because the second Destination (Pascal Script) should not be executed when the move of a source file is not successful.

    limagito file mover function setup

    • Destination Setup:
      • First Destination must be the actual Desination of the Source Files, in our case a Windows folder
      • Second Destination is a Pascal Script which will count the total number of files successfully moved and will keep track of the pages of each pdf file.
        • This info is used in the Rule email event.

    limagito file mover destination setup

    limagito file mover windows folder as destination

      • Add the following ‘Destination’ Pascal Script:  link

    limagito file mover pascal script as destination

    • RunTime Log Result:

    limagito file mover runtime log result

    • Email Result:

    limagito file mover include pdf page count email result

    If you need any help with this ‘include pdf page count’ request, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team PDF ,
  • 13 Apr

    Rename files before they are delivered to destination

    Q: For a particular transfer job, we have a need to rename files before they are delivered to destination. What we really need is to append the time and data to the file name before file extension. Can you please let me know how can I use this option efficiently to achieve what I am looking for. Example

    Actual file name: Data0018.dat

    Final file name at destination: Data0018<hhmmmmddyyyy>.dat

    Test setup of customer:

    limagito file mover Rename files before

    A: Please use our file rename option in your Destination setup:

    RegEx:   (.*)\.(.*)

    Replacement:   \1%TCD:HHNNMMDDYYYY:.\2

    limagito file mover rename files before

    If you need any help with this ‘Rename files before’ question, please let us know.

    Best Regards,

    Limagito Team

    #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Rename
  • 13 Apr

    Running a python script with Command as source but rule doesn’t end

    Running a python script with Command as source but rule doesn’t end

    Q: I’m trying to setup a rule with a cmd as source, it executes a python script. When I execute the rule, it works well (I have the expected result), but the rule doesn’t end. So, I don’t have any output in the Limagito GUI.

    It seems that the process continues to run :

    20/01/2025 12:08:02 Execute Rule Request from administrator at 192.168.92.38 []

    20/01/2025 12:08:02 Execute Command as Source: [CMD] Command, Command Line: CMD /C python xxx\mediaprint_api_v3.py

    20/01/2025 12:08:02 Set CMD as Source Output to C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:02 Execute M1 Command, Exception Error: Cannot perform this operation when process is running

    20/01/2025 12:08:02 Execute Command as Source Succes, ExitCode : 4294967295, Result Path: C:\Users\ADMINI~1\AppData\Local\Temp\LimagitoX\LimagitoX.83\

    20/01/2025 12:08:07 Rule Disabled by administrator at 192.168.92.38 []

    Should I check an option when configuring the rule to avoid that ?

    A: You are using CMD /C so that part is OK. I guess you need to add something to the python script that will close afterwards.

    ChatGPT info:

    limagito file mover Running a python script

    Customer feedback:

    Indeed, i was trying things and I it ended successfully with a sys.exit(0)

    If you need any help with this ‘Running a python script’ question, please let us know.

    Best Regards,

    Limagito Team

    #python #managedfiletransfer #filetransfer #filemanagement

    By Limagito-Team Command ,
1 2 3 4 151
SEARCH