Jump to content
hfr

Allow {TAB} for Snippets

Recommended Posts

Hi,

 

I would like to auto-fill forms with Snippets (v.3). Therefore I'd like to use the TAB command to navigate from one field (e.g. name) to the next (e.g. address).

 

The example would be:

 

---

 

John Doe {TAB}

123 Fakestreet {TAB}

Mytown

 

---

 

Or is there already a workaround for that?

 

Thanks.

Edited by hfr

Share this post


Link to post
Share on other sites

I am afraid that nothing can be done on Alfred side,

but it's more a problem about how forms work.

You can already insert tabs in snippets but a form will not use them to change field, just like you can create in a text editor a string containing tabs and the forms will still not fill.

 

 

Hi,

 

I would like to auto-fill forms with Snippets (v.3). Therefore I'd like to use the TAB command to navigate from one field (e.g. name) to the next (e.g. address).

 

 

Share this post


Link to post
Share on other sites

I am afraid that nothing can be done on Alfred side,

but it's more a problem about how forms work.

You can already insert tabs in snippets but a form will not use them to change field, just like you can create in a text editor a string containing tabs and the forms will still not fill.

 

I have no idea how complicated this would be - but it should be possible (see Typinator or KeepassX). Please correct me if I'm wrong.

Edited by hfr

Share this post


Link to post
Share on other sites

I have no idea how complicated this would be - but it should be possible (see Typinator or KeepassX). Please correct me if I'm wrong.

 

Yes, I see now...

you are right, I did try Typinator and effectively is able to do it.

 

I believe that simple tabs in text does not work, but typinator is able to paste the first field and then simulate a tab key, and so on...

 

you are right is feasible

 

    Giulio

Share this post


Link to post
Share on other sites

> You can already insert tabs in snippets but a form will not use them to change field

 

I think there is confusion here between:

 

1. TAB to cycle between fields in an external form (on a webpage) 

2. TAB to cycle between fields of a snippet that has placeholders

Share this post


Link to post
Share on other sites

> You can already insert tabs in snippets but a form will not use them to change field

 

I think there is confusion here between:

 

1. TAB to cycle between fields in an external form (on a webpage) 

2. TAB to cycle between fields of a snippet that has placeholders

 

I'm referring to option 1 - cycling through fields in an external form.

 

(Typinator is capable of doing that, Alfred not at the moment)

Edited by hfr

Share this post


Link to post
Share on other sites

This is the reason I haven't moved all my snippets over from aText... would be awesome to have them all in one place, and Alfred makes them much more searchable.

Share this post


Link to post
Share on other sites

Seems like this just needs to be combined with the new "dispatch key combo" workflow output. Would be awesome to include delays in snippets, too.

Share this post


Link to post
Share on other sites

I am afraid that nothing can be done on Alfred side,

but it's more a problem about how forms work.

You can already insert tabs in snippets but a form will not use them to change field, just like you can create in a text editor a string containing tabs and the forms will still not fill.

 

 

I'm not sure that's absolutely true.

 

I've had an issue with a Typinator snippet that should insert the symbol for Backspace but instead performs a backspace and deletes the preceding character.

 

That's most likely a bug, but it also shows that snippet expanders can "perform" a TAB as well as insert one.

Share this post


Link to post
Share on other sites

Seems like this just needs to be combined with the new "dispatch key combo" workflow output. Would be awesome to include delays in snippets, too.

 

Yes, that's what I thought, too. There is no way to combine this yet, is there?

Edited by hfr

Share this post


Link to post
Share on other sites

Yes, that's what I thought, too. There is no way to combine this yet, is there?

Only from the other direction, unfortunately. If you use AppleScript to keystroke a snippet keyword, Alfred expands the snippet.

 

So assuming zzname is a snippet Keyword for your name and zzemail is a snippet keyword for your email address, this AppleScript will type the snippet triggers (which Alfred or another snippet expander app will expand), tabbing between fields in between:

tell application "System Events"
    keystroke "zzname"
    delay 0.3
    -- Simulate TAB keypress
    key code 48
    delay 0.1
    keystroke "zzemail"
    delay 0.3
end tell
Nowhere near as convenient as kicking it off via a snippet Keyword, but it might be of use to somebody. Edited by deanishe

Share this post


Link to post
Share on other sites

Only from the other direction, unfortunately. If you use AppleScript to keystroke a snippet keyword, Alfred expands the snippet.

 

So assuming zzname is a snippet Keyword for your name and zzemail is a snippet keyword for your email address, this AppleScript will type the snippet triggers (which Alfred or another snippet expander app will expand), tabbing between fields in between:

tell application "System Events"
    keystroke "zzname"
    delay 0.3
    -- Simulate TAB keypress
    key code 48
    delay 0.1
    keystroke "zzemail"
    delay 0.3
end tell
Nowhere near as convenient as kicking it off via a snippet Keyword, but it might be of use to somebody.

 

 

Thanks for the workaround! Let's see what future updates will bring. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...