Clickable Macro Scheduler Functions List

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Clickable Macro Scheduler Functions List

Post by JRL » Tue Apr 15, 2014 9:54 pm

I've always liked seeing the entire list of Macro Scheduler functions all in one place.

Back in previous versions they were displayed on a single page in categories, then alpha sorted within those categories. Looking at that list kept me familiar with functions I may not use very often. The current method of viewing functions in help requires that you know the function you're after and that you know the category the function is listed under. My old brain loses contact with functions I don't often use and I find myself searching through the entire list one category at a time trying to figure out what function I want.

I also have trouble with remembering the exact spelling of system variables. With this I can just scroll down to one and there it is.

This program reads your comdef.ini file. The file, by default, will reside in the same folder as your scripts. If it is not there, you'll have to specify a path to the file. This can be done by altering the first line in the script.

The script presents all of the Macro Scheduler functions and system variables sorted in alphabetical order. Scroll through the list until you see a function you like then double click on it and you will be taken to Macro Scheduler's on-line help for that function.

Or you can single click and just place the function or system variable in the clipboard.

Comments/enhancement requests welcome.

This script requires Macro Scheduler version 12 or greater.

Code: Select all

Let>ComdefPath=%Script_dir%

LabelToVar>StringExpressions,VarStrExp
ReadFile>%ComdefPath%\comdef.ini,data
Separate>data,CRLF,Line
Let>vFunctionList=
Let>kk=0
Repeat>kk
  Add>kk,1
  Let>value=Line_%kk%
  Separate>value,[,seek
  If>seek_count>1
    Separate>Seek_2,],function
    If>%Function_1%=H|T|O
      Goto>SkipWrite
    EndIf
    If>%Function_1%=1/0
      Goto>SkipWrite
    EndIf
    If>%Function_1%=_Abbreviations
      Goto>SkipWrite
    EndIf
    If>%Function_1%=EDITOR_HISTORY
      Goto>SkipWrite
    EndIf
    ConCat>vFunctionList,%function_1%%crlf%
  EndIf
  Label>SkipWrite
Until>kk=%Line_Count%

Dialog>Dialog1
object Dialog1: TForm
  Left = 490
  Top = 205
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Position = poScreenCenter
  Caption = 'Function List'
  ClientHeight = 614
  ClientWidth = 287
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  DesignSize = (
    287
    614)
  PixelsPerInch = 96
  TextHeight = 13
  object MSListBox1: tMSListBox
    Left = 6
    Top = 3
    Width = 275
    Height = 606
    Anchors = [akLeft, akTop, akRight, akBottom]
    ItemHeight = 13
    Sorted = True
    TabOrder = 0
    SelectedIndex = -1
  end
end
EndDialog>Dialog1

SetDialogProperty>Dialog1,MSListBox1,Text,vFunctionList
AddDialogHandler>Dialog1,MSListBox1,OnDblClick,Process
AddDialogHandler>Dialog1,MSListBox1,OnClick,ClipBoard

Show>Dialog1,

SRT>Process
  GetDialogProperty>Dialog1,MSListBox1,SelectedItems,Var
  ReadIniFile>%ComdefPath%\comdef.ini,Var,Description,MathExpTest
  If>MathExpTest<>
    MidStr>MathExpTest,1,27,MathExpTest
  EndIf
  If>{%MathExpTest%="Complex Expression function"}
    Let>Var=arithmeticfunctions
  Else
    Separate>VarStrExp,Var,StrExpTest
    If>StrExpTest_Count>1
      Let>Var=stringfunctions
    Else
      ReadIniFile>%ComdefPath%\comdef.ini,Var,Caption,CapTest
      If>CapTest<>
        Let>var=systemvariables
      Else
        LowerCase>Var,Var
      EndIf
    EndIf
  EndIf
  ExecuteFile>http://www.mjtnet.com/manual/%var%.htm?zoom_highlightsub=%var%
END>Process

SRT>ClipBoard
  GetDialogProperty>Dialog1,MSListBox1,SelectedItems,Var
  PutClipBoard>Var
END>ClipBoard

/*
StringExpressions:
Upper
Lower
Copy
Pos
Length
Trim
LTrim
RTrim
*/

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Thu Apr 24, 2014 12:15 am

I like that! Very clever indeed! :D
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Apr 24, 2014 2:04 pm

Nice. As it happens I wanted to make a list of functions on the new knowledge base and was about to write a script. This sped up my work. Here's the end result:

http://help.mjtnet.com/article/150-command-reference
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts