How to write macros

I’m curious as to how macros will work. I’m thinking something I’d like to add to the TextBlade would be a function to change case. E.g. Lowercase, uppercase, sentence case, title case, camel case, snake case, etc. As a developer I’d use these quite a bit and it would be good to separate this from the IDE.

So are there any details as to if and how I could achieve this? Is this part of multi map? What language do you write the macros in?

Appreciate you might not be ready to disclose this information yet, but it would be nice to know if it is possible before I get ahead of myself and dream up more complicated stuff.

2 Likes

I think you’re right, but you never know what these waytools guys have up their sleeves. They did mention a programming API, so maybe it could be accomplished through that.

1 Like

In which case, don’t trust anyone who asks you to type your password in on a Text Blade!

1 Like

I will be very surprised if the macro facility is anything more than the ability to play back a series of stored keystrokes by pressing a single key combination. In such a scenario the Textblade has no idea what the host it is connected to is actually doing. Also the host does not know that the Textblade is anything other than a keyboard device. This would apply whether the stored keystrokes were to activate some host functionality, or to do something like enter a password stored on the Airtame.

That is not to say that additional capability will not be possible via the API. However I would expect that to be primarily oriented towards the sort of capabilities that MultiMap will exploit. It does mean that apps that are ‘TextBlade’ aware may well have some special capabilities relating to using a Textblade, but such apps will be rare I would have thought. However until we get more detail on the API and the functionality it exposes that is pure supposition.

Yep, I think you’re absolutely right. I was thinking about the comment someone made about putting the TB in calculator mode, but that is somewhat different to my use case. For the calculator you’d essentially tell the TB when to start recording key presses and pass them to your function. With my scenario you’d have to select some text and have the TB read the contents. So I agree, I don’t think this will be possible. Ah well.

MultiMap let’s you define your own macros – including text snippets and even control sequences and app shortcuts.

You can type or paste these into our App, and save them in your TextBlade hardware, or in your space on our Cloud server.

You can call these macros on demand from your TextBlade, and it’ll stream those characters into your current app.

For folks who want to extend functionality beyond this, you can also write JavaScript functions that modify the currently selected text in your document. JavaScript macros are available when you use TextBlade with our companion iOS keyboard extension (we’ll also port the keyboard extension to additional platforms after release).

MultiMap comes with an open source library of JavaScript macros – including basics like changing case, and some goodies for developers too. We’ll expand this library over time, and also publish submissions from the community. (Camel and snake case would be cool!)

If you really want to go full tilt – the MultiMap API lets developers create their own apps & keyboard extensions that talk to TextBlade.

For security, all that functionality is locked and requires that you enable access.

ajp1034 - lol! In general, never type passwords on someone else’s PC. No way to know if they’re running common keystroke recording SW on the host. There are many ways for bad guys to do stuff, faster than writing malware to hijack a TextBlade.

4 Likes

Wow! Sounds like I’ll be spending a lot of time typing out macros on my Text Blade, for my Text Blade just for the fun of it. Cool.

So, by the keyboard extension you mean that if I’m paired with a Linux PC they’d have to be some progress running to allow the TB to grab the text, etc. Except that Linux will be so far down your backlog that it might never be implemented :frowning:

Oh, but you mean I’ll be able to create the Linux app myself? Or will the API not work on Linux?

Yes, there will be a TextBlade API for Linux.

After release, we’l be porting the API to Android, Windows and Linux.

The API will be the first to arrive on each new platform. (Our app and keyboard extension builds uses the API internally).

4 Likes

I love you guys. You’ve made me very happy :slight_smile:

4 Likes

On the windows side if you have the ability to run non standard software autohotkey can map and macro any key codes sent extremely well.

The downside for road warriors hoping to use this on corporate machines is that there is generally a no install policy.

In practice if I can connect a keyboard device then I can almost certainly run a portable version of autohotkey. This is usually a gray area.

Do you plan to include Python as well?

charmaex - We chose JavaScript because a high performance interpreter is already built into iOS and Android, and it’s also very commonly used today (widespread developer base). For reference, which OS do you develop on?

Robert - As a note, most macros (with the exception of ones that need to run JavaScript code on the host) can be loaded directly onto the TextBlade, making software install on Windows systems purely optional. We expect the most common use of macros to be pre-composed text snippets (they don’t require installing any software)

1 Like

I only use Pythonista for some workflows on iOS to edit some of my documents.
Not programming any apps.

Can we please get an sdk release soon? We tinkerers are ready to start coding awesome stuff on some ghetto 107 key hardwired keyboards and an emulated environment.

Bonus for you, @waytools, as it will distract the masses from all the waiting.

2 Likes