Blog | Octane Software Solutions

Automation in TM1 using AutoHotkey

Written by Rajan Bajracharya | March 2, 2020

This blog explains a few TM1 tasks which can be automated using AutoHotKey. For those who don't already know, AutoHotKey is open-source scripting language used for automation.

1. Run TM1 Process history from TM1 Serverlog :

With the help of AutoHotKey, we can read each line of a text file by using loop function and content is stored automatically in an in-built variable of function. We can also read filenames inside a folder using same function and again filenames will be stored in an in-built variable. Therefore, by making use of this we can extract Tm1 process information from Tm1 Serverlog and display the extracted information in a GUI. Let’s go through the output of an AutoHotKey script which gives details of process run.1. 

  • Below is the Screenshot of output when script is executed. Here we need to give log folder and data folder a path.

  • After giving the details and clicking OK, list of processes in the data folder of Server is displayed in GUI.



  • Once list of processes are displayed, double-click on process to get process run history. In below screenshot we can see Status, Date, Time, Average Time of process, error message and username who has executed the process. Thereby showing TM1 process history in TM1 server log. 

 

2. Opening TM1Top after updating tm1top.ini file and killing a process thread

With the help of same loop function which we had used earlier, we can read tm1top.ini file and update it using fileappend function in AutoHotKey. Let’s again go through the output of an AutoHotKey script which will open Tm1top.

  • When script is executed, below screen comes up which will ask whether to update adminhost parameter of tm1top.ini file or not.

  • Clicking “Yes”, new screen comes up where new adminhost is required to be entered.

  • After entering value, new screen will ask whether to update servername parameter of tm1top.ini file or not.

  • Clicking “Yes”, new screen comes up where new servername is required to be entered.

  • After entering a value, Tm1Top is displayed. For verifying access, username and password is required

  • Once access is verified, just enter the thread id which needs to be cancelled or killed.