Global Mapper Pro

add start time to script

koenv
koenv Global Mapper User
edited July 2015 in GM Script Language
Hi,

Is it possible to add a starting time to global mapper scripts? Something like "START TIME: 14-03-2012 13:50"?
If yes, then what is the exact code to right into the script?

Thanks,
Koen

Comments

  • global_mapper
    global_mapper Administrator
    edited March 2012
    Koen,

    There isn't currently any support for something like that. Would the purpose be to delay the start of the script until a certain time?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • Geo
    Geo Global Mapper User Trusted User
    edited March 2012
    Windows > Desktop > Learn > Reference > System Administration > Task Scheduler
    Purpose

    The Task Scheduler enables you to automatically perform routine tasks on a chosen computer. The Task Scheduler does this by monitoring whatever criteria you choose to initiate the tasks (referred to as triggers) and then executing the tasks when the criteria is met.
  • koenv
    koenv Global Mapper User
    edited March 2012
    That's correct. the purpose would be to start up something as soon as you expect your input data to be ready.
    Thanks,
    Koen
  • Geo
    Geo Global Mapper User Trusted User
    edited March 2012
    Koen,

    if the input data are processed from another script (global mapper or other software), you can launch your next script after the first one is completed with a batch file.

    you can use tasklist.exe to track when the first script is completed, or better, at my point of view, Process Viewer for Windows command-line utility (72 ko), with the -x option.

    see Scripting Language Reference Batch Mode Operation
    You can run a Global Mapper script file automatically be passing it on the command line to the Global Mapper .exe file. The script file will be run with no user interface displayed and Global Mapper will immediately exit when the script file completes processing. This allows you to easily run Global Mapper scripts from another application or from a DOS batch file. Note that your script files need to have an extension of .gms for this to work.


    sample.bat :
    @ECHO OFF
    
    REM run gms scripts found in current folder, one after one, in name script order
    REM display on screen the name of the script being processed
    
    FOR %%H IN (*.gms) DO (
        ECHO %%H
        pv -x global_mapper13.exe 2>NUL
        "%PROGRAMFILES%\GlobalMapper13\global_mapper13.exe" %%H.gms
        )
    
    REM wait user input before closing window
    PAUSE
    

    output :
    $p$g>sample.bat
    0.gms
    1.gms
    2.gms
    3.gms
    4.gms
    5.gms
    Press any key to continue . . .
    
    
  • koenv
    koenv Global Mapper User
    edited March 2012
    Hi Geo,

    The ".gms" should be removed from the line

    "%PROGRAMFILES%\GlobalMapper13\global_mapper13.exe" %%H.gms

    After that, it worked just fine. Thanks a lot
  • Geo
    Geo Global Mapper User Trusted User
    edited March 2012
    koenv you are right,
    I should have tested more thoroughly before posting. ;)


    edited_sample.bat :
    [COLOR="#EE82EE"]@[/COLOR][COLOR="#0000FF"]ECHO OFF[/COLOR]
    
    [COLOR="#008000"]REM run gms scripts found in current folder, one after one, in name script order[/COLOR]
        [COLOR="#0000FF"]FOR[/COLOR] [COLOR="#FFA500"]%%H[/COLOR] [COLOR="#0000FF"]IN[/COLOR] ([COLOR="#FF0000"]*[/COLOR].gms) [COLOR="#0000FF"]DO[/COLOR] [COLOR="#00FFFF"]([/COLOR]
        [COLOR="#008000"]REM display on screen the name of the script being processed[/COLOR]
            [COLOR="#0000FF"]ECHO[/COLOR] [COLOR="#FFA500"]%%H[/COLOR]
        [COLOR="#008000"]REM pv.exe is located in %path% or in sample.bat's directory[/COLOR]
            [COLOR="#00FFFF"]pv[/COLOR] -x global_mapper13.exe 2[COLOR="#FF0000"]>[/COLOR][COLOR="#0000FF"]NUL[/COLOR]
        [COLOR="#008000"]REM run script[/COLOR]
            "[COLOR="#FFA500"]%PROGRAMFILES%[/COLOR]\GlobalMapper13\global_mapper13.exe" [COLOR="#FFA500"]%%H[/COLOR]
            [COLOR="#00FFFF"])[/COLOR]
    
    [COLOR="#008000"]REM wait user input before closing window[/COLOR]
        [COLOR="#0000FF"]PAUSE[/COLOR]
    
  • mangre
    mangre Global Mapper User
    edited July 2015
    Hi I know this is an old post.
    I am very new to scripting, but have managed to create a script in Global Mapper , export_raster command.
    This gives me what I need .tif and a .twf file.
    I have many areas to process and run each area manually in the Global Mapper window. as .GMS export_raster file command.bandicam 2015-07-06 11-01-28-654.jpg
    I have now created a .bat file to run and open the .gms scripts, the command opens GM and says it has run the .gms script.
    But It has not saved a .tiff or .twf file, it just opens GM. for each .gms script.

    This is the it below
    bandicam 2015-07-06 11-26-58-436.jpg

    If anyone could possibly direct me here it would be of great value to me.
    bandicam 2015-07-06 10-56-08-746.jpg
Sign In or Register to comment.