News:

Welcome to our NEW forum! We invite you to sign up today
so it can grow to be a valuable resource to all Toolbox users!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - oblivion

#1
Feature Requests / Re: Window-specific menus
October 21, 2026, 05:32:27 PM
So do you mean a kind of way of enabling a bunch of text expansions or hotkeys that are only applicable when a specific application has focus?

I think, if you wanted (say) alt+F6 to behave differently depending on which application had focus, you could certainly write that into the action code, using something like

Action: Continue if "{notepad.exe}=1"
Not that it's quite the same thing, but I have a fairly complex text expansion that (without going into details) runs a process that gets the next number from the end of a bunch of saved files, increments that number and then types the filename with the incremented number suffixed to it. In principle, it'd be possible to ensure that it only did anything at all if the application that's saving the file was running; and equally, it could be coded to work differently if a different application had focus.

But I suspect if you wanted to have a set of application-specific text expansions enabled or disabled depending on whether a specific application had focus, that might be a challenge. Maybe Paul might think about making it possible for an entire action group to be associated with one or more applications and unavailable otherwise, but that feels like it might be asking quite a lot, particularly as you'd probably want the option to reuse hotkeys between different applications.
#2
Not sure why it's taken me so long to try this extremely cool action.

I should say that it works perfectly but it wouldn't work for me until I'd added

0001 Wait: For action hotkey to be released ""
at the first line.
#3
Feature Requests / Messageboxes and formatting
October 20, 2026, 09:21:18 PM
This might be a big ask, and it's entirely cosmetic so I wont be upset if it's too complicated or trivial to bother with!

In the context of my cheat sheet script tutorial, I found myself wishing I could format the message text a bit better.

A couple of possibilities occur to me: first, might it be possible to support tabs, so text that's not at the start of the line could be aligned?

Second, might it be possible to support colours?

So -- if I had both wishes granted, I could do something like

Data: Add [darkblue]name${tab}[darkred]header$

and my output would be prettified?


#4
Feature Requests / Re: Unavailable hotkeys
October 20, 2026, 09:06:53 PM
I just found this again, it reminded me of a thought I'd had. Probably trivial, but how about a click on the Trigger column header to be a shortcut to /any so you get an instant filter to everything with a defined trigger?

I suppose you could have it toggle between /any, /hk, /ty and no filter too...
#5
Tips and Tricks / [tutorial] Automating a cheat sheet
October 19, 2026, 02:00:44 AM
First and foremost, you must have a version of Toolbox at or above 9.0.0.5 to be able to run the action documented below.

This is because it relies on an internal variable that didn't previously exist, a new comparison operator and also a bugfix for user-created variables.

This is a long post. There's a lot of stuff that gets explained here: user-defined variables, decision making, looping through an indefinite number of files, swapping data into and out of variables with specific uses... I've tried to explain everything fairly clearly but if you're new to scripting, there's a lot to take in here.

The intention is to make a cheat sheet for actions that have been created but you might need reminding of, and to do it in such a way that you don't have to remember to update a separate cheat sheet -- because that's what I did, until recently, and kept forgetting to add new actions to the list.

So you need to make an actions group containing all the actions you want to be reminded of. The script assumes you've called this "My Useful Stuff" and that you've moved all the actions you want reminders for the triggers of into it. We're also assuming here that no actions in this group are missing a trigger.

A quick aside: In the Automation tab, you have a list of actions in the left pane, headed by a dropdown list of groups that have been set up as part of the original installation and possibly added to by you. In case you've never touched what's there, you're probably looking at (All) in the dropdown. If you right-click the dropdown, click on "+New..." you can create a new group. If you want to follow this tutorial without having to modify anything else, call it "My Useful Stuff".

You can move actions between groups by right-clicking the action's name, clicking Move and choosing the group you want to move the action to. For the purposes of this, you should move anything with a defined trigger you struggle to remember to the "My Useful Stuff" group or, if you prefer a different group name, modify the relevant line in the below script. I'll mention this again later.

One key bit of this arose from a discussion elsewhere, where our brilliant developer pointed out that the actions are held in individual files and that the first line of each file is its defined trigger. There are actions that are text expansions (where you type something that Toolbox reacts to -- I call these hotstrings) and actions that respond to keypresses, like control-F1, which I call hotkeys. Recognising hotstrings is easy: the first four characters of that first line are always "Text".

Hotkeys are harder, and only really possible if we can assume that if an action isn't a hotstring, it MUST be a hotkey. Which is why everything in the group we're looking at must have a trigger, because otherwise actions with no trigger will also be reported as a hotkey. (It's possible to code round that, but I've chosen to deal
with that by ensuring we populate the group carefully in the first place, for simplicity.)

So what we want to do is look at each file in turn and make two lists, one of hotkeys and the other of hotstrings, then list both groups separately once the two lists are complete.   

Most of the commands we'll need to use to achieve this can only be performed on the string$ and data$ variables. So we'll need some extra variables to hold important contents of the string$ and data$ variables in order not to lose what we've done as we go through the files.

We can create variables named more or less as we like but watch for a trap: a variable called mydata$ would be treated as the characters "my" followed by the data$ variable so create names carefully and avoid collisions with existing variables. I've tried to make variable names that are reasonably readable without colliding with internal variables, and they're all declared in the first few lines, via String: Assign to variable commands.


0001 String: Clear ""
0002 String: Assign to variable "tph$"
0003 String: Assign to variable "tpt$"
0004 String: Assign to variable "header$"

I don't think it's stated anywhere explicitly, by the way, but if you don't declare the variables you're going to use in this way, the action will fail.

tph$ and tpt$ will be the lists: tpt$ will hold the lines starting "Text", and tph$ everything else, being the hotstrings.

0005 Folder: Assign "tooldata$\Actions\My Useful Stuff"

Tooldata$ is an internal variable that points at Toolbox's Data folder. The Actions subfolder contains the names of the action groups as subfolders, and "My Useful Stuff" is where all the actions we want to be reminded of have been put. If your action group is named differently, this is the only step you need to modify to match. The Folder: Assign command is a statement to Toolbox that this is the place we're going to be looking at the files contained within.

0006 Folder: Start of file processing ""

We have a process that will be applied to each of the files in the assigned folder, and this line is where the code will loop back to while there's still an unprocessed file to examine. That loop back happens at line 0024 below. From this point on, we're dealing with a single file and we have to ensure the process will be able to applied to anything we find.

0007   File: Assign "folder$name$"
0008   String: Assign from line number in file "1"

I'm going to quote the Help for line 0007:

QuoteAssigns the file to be used by all 'File' steps. The assigned file is stored in its entirety in the file$ variable; plus its filename alone in filename$, its extension in fileext$, and its folder in filefolder$. The size of the file, in bytes, is stored in filesize$ and will be -1 if the file doesn't exist (because files can actually be 0 bytes in size).

Line 0008 reads the first line of the active file and assigns it to the string$ variable. We're going to need string$ for other stuff later so

0009   String: Assign to variable "header$"

puts the string$ variable into our header$ variable we created in line 0004 as we'll need it for whichever of our lists it'll be put into later.

0010   String: Clear ""
0011   Data: Clear ""

Ensure string$ and data$ are both empty.

0012   Action: Do this block if "header$[Type"

The header$ variable contains the first line of the file we're looking at. The [ comparison operator here means "starts with" so what we're saying here is, if the file we're looking at is a text expansion, the next few lines (until the Action: End of block command) should be processed, but otherwise the block should be skipped.

So lines 0013 to 0016 are processed only because we now know that we're dealing with a text expansion.

0013   Data: Assign "tpt$"
0014   Data: Add "name$ = header$~"
0015   String: Assign "data$"
0016   String: Assign to variable "tpt$"
0017   Action: End of block ""

Line 0013 puts the current content of our list of text expansions into the data$ variable, line 0014 adds the filename, an equals sign surrounded by spaces, the first line of the file and a linefeed (the ~ symbol) to the data$ variable, line 0015 assigns the content of the data$ variable to string$ and line 0016 puts the updated version into tpt$. Line 0017 finishes the block, which you'll remember we've only processed because we know we're dealing with a text expansion.

So now we need a similar block for our hotkeys. This time, we're going to use a new comparison operator:

0018   Action: Do this block if "header$[!Type"

So this time, the comparison operator is [! -- which means "does NOT start with." You'll remember that we can only recognise a hotkey because it doesn't match the definition of a hotstring? So if the first line of the file is NOT the word "Text" we're dealing with a hotkey.

The block is then a near copy of the block above, but using the hotkey variable instead of the hotstring variable:

0019   Data: Assign "tph$"
0020   Data: Add "name$ = header$~"
0021   String: Assign "data$"
0022   String: Assign to variable "tph$"
0023   Action: End of block ""

So we've done all we need, so we can get the next file and loop back to line 0006:

0024 Folder: End of file processing ""

Once all the files have been processed, we now have two complete lists: tph$ is our list of hotkeys, tpt$ is the list of text expansions. All that remains now is to display them.

My preference is to show them in separate message windows, hotkeys first then text expansions.

0025 Alert: Show a message "Hotkeys are:~~tph$"
0026 Alert: Show a message "Text expansions are:~~tpt$"

However, if you'd rather have hotstrings first, just switch those two lines round. And if you'd rather do everything in one message, you could do something like

0025 Alert: Show a message "Hotkeys are:~~tph$~~Text expansions are~~tpt$"

And the entire action, without my blathering between chunks, is

(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 String: Clear ""
0002 String: Assign to variable "tph$"
0003 String: Assign to variable "tpt$"
0004 String: Assign to variable "header$"
0005 Folder: Assign "tooldata$\Actions\My Useful Stuff"
0006 Folder: Start of file processing ""
0007   File: Assign "folder$name$"
0008   String: Assign from line number in file "1"
0009   String: Assign to variable "header$"
0010   String: Clear ""
0011   Data: Clear ""
0012   Action: Do this block if "header$[Type"
0013   Data: Assign "tpt$"
0014   Data: Add "name$ = header$~"
0015   String: Assign "data$"
0016   String: Assign to variable "tpt$"
0017   Action: End of block ""
0018   Action: Do this block if "header$[!Type"
0019   Data: Assign "tph$"
0020   Data: Add "name$ = header$~"
0021   String: Assign "data$"
0022   String: Assign to variable "tph$"
0023   Action: End of block ""
0024 Folder: End of file processing ""
0025 Alert: Show a message "Hotkeys are:~~tph$"
0026 Alert: Show a message "Text expansions are:~~tpt$"
(End)

Now you've got this, assign it a memorable trigger (I use ctrl-F1) and any time you make a new action that you want to be able to be reminded of the trigger for, all you need to do is put it in your "My Useful Stuff" group.

#6
Help and Support / Re: Variables
October 18, 2026, 02:58:20 AM
I can confirm that variables now work as I expected them to :)

Again for onlookers, I tripped over the problem while trying to develop a version of my Action list script that separated out hotstrings from text expansions; as it needs the (new) tooldata$ variable and the bugfix to work, I'll hold off posting it -- but I'll write it up as a tutorial once the updates have made it into the release version of Toolbox.
#7
Help and Support / Re: Variables
October 15, 2026, 11:46:56 PM
That's helpful, thanks.

However... trying to write code that will effectively maintain two different copies of data$, each held in variables I've created, where a decision about which variable to move into data$, modify and then move back to the variable is just failing miserably. Looking at debug output, I seem to be making multiple identically-named variables rather than just one with variable content. Are variables local to blocks and, if so, is it possible to make them local to the entire action so they can be shared between decision blocks?

#8
Help and Support / Variables
October 13, 2026, 06:53:50 AM
Is there anything intrinsically different about the data$ variable from -- say -- string$ or a user-created variable?

Let's say I wanted to use the Data: Add function to move stuff into data$ but I wanted to use Data: Add to modify different variables, if I used string$ or mydata$ to hold a copy of a data$ variable I'd previously created while I messed with another version of data$, would anything break?
#9
Feature Requests / Re: Action list
October 11, 2026, 08:24:02 PM
Phteven and GCRedditor136 -- you've absolutely nailed it. :)

Once the tooldata$ variable is implemented in the main release, I'm going to put my current version of the action up, with lots of explanation and so on, as a tutorial in the Tips section. It's been a useful learning exercise for me so hopefully that'll apply to other people too!
#10
Feature Requests / Re: Action list
October 09, 2026, 05:02:05 PM
So you did. :)

New version -- the tooldata$ variable in place and working. MUCH improved for portability and readability too! Thanks :)
#11
Feature Requests / Re: Action list
October 09, 2026, 01:21:55 AM
The tooldata$ variable is definitely a Good Thing, particularly for portable setups. I haven't been able to download the update yet -- for some reason, although the website is available (or I wouldn't be typing this!) I get "not available" errors when I try the download. Might be an issue with my network setup, and I'm working off a hotspot right now which might also be an issue, but I'll check it out as soon as I can. Thanks, as always!
#12
Feature Requests / Re: Action list
October 08, 2026, 09:16:48 PM
Now this version might be good enough to keep. :)

(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Folder: Assign "C:\[Tim]\[Toolbox]\Toolbox Data\Actions\My Useful Stuff"
0002 Alert: Ask for a choice "What type of actions do you want to see?~Hotkeys=hotkeys~Expansions=text"
0003 Action: Do this block if "alert$=hotkeys"
0004   Folder: Start of file processing ""
0005   File: Assign "folder$name$"
0006   String: Assign from line number in file "1"
0007   String: Get first chars "4"
0008   Action: Do this block if "string$<>Type"
0009     File: Assign "folder$name$"
0010     String: Assign from line number in file "1"
0011     Data: Add "name$ = string$~"
0012   Action: End of block ""
0013   Folder: End of file processing ""
0014 Action: End of block ""
0015 Action: Do this block if "alert$=text"
0016   Folder: Start of file processing ""
0017   File: Assign "folder$name$"
0018   String: Assign from line number in file "1"
0019   String: Get first chars "4"
0020   Action: Do this block if "string$=Type"
0021     File: Assign "folder$name$"
0022     String: Assign from line number in file "1"
0023     Data: Add "name$ = string$~"
0024   Action: End of block ""
0025   Folder: End of file processing ""
0026 Action: End of block ""
0027 Alert: Show a message "data$"
(End)

I have noticed that a block inside a block doesn't get a second indent when copied to the clipboard, so I've added that manually :)

Also -- I think I've asked this before but I might not have done -- might it be possible to suppress the "Search" element of the "Alert: Ask for a choice" step?
#13
Feature Requests / Re: Action list
October 08, 2026, 08:01:32 PM
This is going to grow, I think, but I have a working interim action that reads through the actions in a target group and JUST lists those that are text expansions (as the trigger starts with the word "Type")

(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Folder: Assign "C:\[Tim]\[Toolbox]\Toolbox Data\Actions\My Useful Stuff"
0002 Folder: Start of file processing ""
0003  File: Assign "folder$name$"
0004  String: Assign from line number in file "1"
0005  String: Get first chars "4"
0006  Action: Do this block if "string$=Type"
0007  File: Assign "folder$name$"
0008  String: Assign from line number in file "1"
0009  Data: Add "name$ = string$~"
0010  Action: End of block ""
0011 Folder: End of file processing ""
0012 Alert: Show a message "data$"
(End)

There's probably a better way to do that without putting line 1 of the action in string$ twice, but this has proved the principle -- now I need to embed it in a bigger action that'll ask me if I want text expansions or not and react accordingly. Back later. :)

#14
Feature Requests / Re: Action list
October 08, 2026, 07:15:22 PM
...so now I look at how the actions are stored and what they contain... 

Hm. New ideas. I'll be back. :D
#15
Bug Reports / Re: Missed event notifications
October 08, 2026, 07:01:49 PM
Yes indeed. :)