Jump to content

Allow {TAB} for Snippets


hfr

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
Link to comment
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).

 

 

Link to comment
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
Link to comment
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

Link to comment
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

Link to comment
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
Link to comment
Share on other sites

  • 3 months later...

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.

Link to comment
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
Link to comment
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
Link to comment
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. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...