Jump to content

Alfred as Text Expander


Recommended Posts

Im looking for simple Text Expander functionality. Say I want to quickly fill out a address form on a webpage. I would focus the cursor in the first field, active Alfred, and Alfred would paste my name first, Tab to get to another field, paste test into that and so on. 

 

Tab works in Textmate but doesn't jump between html fields in a webpage. 

Link to post
Share on other sites

At this point, this is fairly unlikely as this would get to depths comparable to Text Expander and would be complex enough to be its own app. You could have a play around with scripts but for now, I'll say unlikely. :)

Link to post
Share on other sites

I use it daily. There must be some step that you are missing.

 

My use case:

1. Create the keyword. For this example, we'll say I'm creating one for my name. So I would set the keyword to be ',df'.

2. Create the Copy to Clipboard output item. Set the data to be copied to be 'David Ferguson'. Set the option to paste to front app.

3. Connect the keyword to the copy to clipboard output.

4. Go to web, apps, etc

5. Cmd+Space to pop up Alfred

6. Type ',df' and press Enter.

 

I used this exact method to expand ',df' into 'David Ferguson' above, and right here. So it works in browsers/in forms.

Link to post
Share on other sites

And by using the tab key in the paste field, you can get Alfred to jump between two input text field in a html page? I cant seem to get that working. 

If I use the workflow in a pure text field like this, I can see the tab in the text, but it doesnt read as a tab (special key) so it wont jump fields. 

Link to post
Share on other sites

What you're looking at doing is using Alfred as a form filler and not a text expansion. These are completely different. Also, something like that is going to be something that is a little more difficult to do because of the fact that web forms are so different. Some have name and email only, some have name, email, address (with 1, 2, or 3 lines), city, state, etc. You CAN do this, but it has the potentially to be wildly inaccurate because of changing forms. To do it would require the use of AppleScript and not using the clipboard. You would have to simulate keystrokes with AppleScript, telling it to keystroke "text", keystroke "Tab", keystroke "text", etc.

Link to post
Share on other sites
  • 1 month later...

I use it daily. There must be some step that you are missing.

 

My use case:

1. Create the keyword. For this example, we'll say I'm creating one for my name. So I would set the keyword to be ',df'.

2. Create the Copy to Clipboard output item. Set the data to be copied to be 'David Ferguson'. Set the option to paste to front app.

3. Connect the keyword to the copy to clipboard output.

4. Go to web, apps, etc

5. Cmd+Space to pop up Alfred

6. Type ',df' and press Enter.

 

I used this exact method to expand ',df' into 'David Ferguson' above, and right here. So it works in browsers/in forms.

 

Thanks for this David - it works great and I now think I'll give Typeit4Me the flick and have one less app to load and take space in the menubar. Regarding your comment about not being a solution as a form filler - I suppose there's also no way to auto insert the date or time (e.g. dt, tm) as with the purpose built text expanders?

 

Thanks 

Link to post
Share on other sites

Hi David Ferguson, 

 

Isn't it too much work setting up text expansions inside workflows? I prefer to use the clipboard snippets built-in feature: It works the same way, it's faster to create a snippet, it lets you set a keyword to do the expansion, and it has a separate keyboard shortcut - so your keywords don't conflict with the rest of the stuff, and you don't even need to set a prefix, like "," before the expansion. :)

 

I only see the need for a workflow if there is some kind of processing involved, like settings arguments or so

Edited by thiagoaraujos
Link to post
Share on other sites

Hi David Ferguson, 

 

Isn't it too much work setting up text expansions inside workflows? I prefer to use the clipboard snippets built-in feature: It works the same way, it's faster to create a snippet, it lets you set a keyword to do the expansion, and it has a separate keyboard shortcut - so your keywords don't conflict with the rest of the stuff, and you don't even need to set a prefix, like "," before the expansion. :)

 

I only see the need for a workflow if there is some kind of processing involved, like settings arguments or so

 

Snippets do indeed work just as well. The only reason that I personally chose Workflows over snippets was because of the additional space required to use a snippet. For example, with snippets the usage to expand my name would be (by default) '; df'. Notice the space between. I moved from DashExpander and TextExpander and was used to something more like ',df', without the space. Workflows allowed me to do that. So yeah, snippets do it and are probably better suited for it, it was all just a personal preference. And I think at the time I started setting that up and playing with it, I'm wanting to say that snippets and the clipboard history for Alfred 2 had not been finished yet :)

Link to post
Share on other sites
  • 11 months later...

I have a file with abbreviation and desired expansions, for example for may LaTeX documents. I have it in Textmate and In there I can expand using this list. Do you think it is possible to make alfrd to read a list like this:

 

;a  \alpha

;b  \beta 

;thm  \begin{theorem} %| \end{theorem}

... ? 

 

and not to have to do every single abbreviation by hand?

 

For example I can export my TextExpander snippets in to a single document (a list). It would be perfect If I can just make Alfred to use the list to expand my snippets. 

Edited by Yoyontzin
Link to post
Share on other sites

Going back to the original point of inserting ⇥, ↩, and others, it is fairly easy with applescript. Take into account, however, this will be like pressing the keys without any checking, so it can lead to undesirable results.

As an example, if you want to fill your first name, press ⇥ to go to the next field, and fill in your last name, you could have a Run Script node using /usr/bin/osascript as the language, and write something like

tell application "System Events"
  keystroke "<your_first_name>"
  key code 48
  keystroke "<your_last_name>"
end tell

key code 48 is ⇥, naturally. Something like Key Codes will help you find other codes you might need.

Link to post
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...