Macro Scheduler Syntax File

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Macro Scheduler Syntax File

Post by Bob Hansen »

I have recently uploaded a newer syntax file for Macro Scheduler, for version 7.2.038.
(Macro Scheduler is available at http://www.mjtnet.com/index.htm?ref=rmh ... rg_2644641)

The following is a copy of emails that were exchanged that I think should have been on the forum. I am submitting for general knowledge:
===================================
Question to me:
Attached is my version of the script from the MS tutorial (change extension) done in TextPad. On it, using your latest syntax file you will see that the words "Program", "Macro", ".exe" are highlighted even when they are not commands. This is not something that happens when the same file is opened in the MS editor...I wonder if there is some way this distraction can be removed? Otherwise looks better than the previous version and works fine in my limited view.
My response:
TextPad does not allow keywords with spaces. If yo uopen the sy file in TextPad, you will see that I included a statement to that effect at the beginning of the Keywords section.

Macro Scheduler has some commands with spaces, like: Run Program, Change Directory, Send Character/Text. There are also keys that are pressed like: Backspace, Enter, Multiply, Divide, Decimal, Add, Subtract, Page, Up, Down, Home, End, Lock, Scroll. EXE is the abbreviated command for "Execute File". Press, Release, Let, and Macro are normal MS commands.

In order to fool TextPad to get them colored, these words have been added to the list of keywords. You can edit the syn file to remove them from the keyword listing, that will stop them from being colored, but it is global, they also will not be colored as part of a command.

MS editor does not use any separate syntax files, it uses built in context sensing of the key words, followed by the > operator. TextPad just looks for keywords anywhere in the text, does not look at the context of its usage. These words will be colored any time they are found.

You will also see some numbers are colored, others are not, because they are part of a word or a comment or a variable. You are dealing with the different constraints of TextPad in these areas. Editing the syntax files can give you some control, but some issues you may have to live with. You can also have multiple syntax files, just select a different one in the Macro Preferences for that class, and you will see different highlighting, coloring, etc.

Personally I use MS to create MS scripts, and use TextPad on MS scripts for special text features that MS does not have like using RegEx expressions. But 99% of time, MS scripts are written in MS. But your needs may vary from mine, I am just passing on my experience after using both of these products for over 5 years. I think they are the two best productivity tools on the market.

Would also encourage you to use the forum for these discussions, so others can benefit from our scar tissue. I will submit your question and my response to the TextPad forum.
Hope this is helpful.............
Flexann
Posts: 1
Joined: Thu Sep 11, 2003 3:17 pm

Macro Scheduler Syntax File

Post by Flexann »

Why and where do you use this syntax file? :oops:

(I use TextPad, and now just downloaded Macro Scheduler and the syntax file... )
mo
Posts: 306
Joined: Tue Mar 11, 2003 1:40 am

Post by mo »

My use is in working on scripts and macros in TextPad which is more comfortable for me than the MS editor, plus it has the clip-book feature which will eventually become a major aid in putting together macros.

To do this you need to create a new document class (I call it "Macro" to be original), and assign the extension *.scp; then load the syntax file into the TextPad "Samples" folder, then expanding the document type and clicking on "syntax" and using the drop down box, find the syntax file and select it. (be sure to check allow syntax highlighting). I also added the extension to the Java class...which is something I vaguely remember one needs to do to make syntax highlighting work...may be wrong or out of date there.
Best Wishes!
Mike Olds
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

I would suggest loading the syntax file into Drive:\Path\TextPad 4\User\ folder vs. the Samples folder. When you do an upgrade to TextPad, I think that the Samples folder may be overwritten and/or deleted. But the User folder is retained. This is the same for user defined Clips, Shortcuts, Macros, and Dictionaries.

You can also load the syntax (and other user defined) files into a folder on a network shared resource so multiple TextPad users can share the syntax and Clip files vs. loading them on each workstation.

Use Configure, Preferences, Folders, and change path to shared resource vs. local drive. Suggest using UNC vs, mapped drive.
Post Reply