Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to add a new TextExpander snippet to do the following:

I will add a url from the clipboard in the form of:

This is my text with a link [1] and one more link [2]

[1] http//link1
[2] http//link2

I wrote this:

[%filltext:name=number:default=1%] %|
[%filltext:name=number:default=1%] %clipboard

But the problem is, I don't know how to add the 2nd link after the first.

I get this instead this:

This is my text with a link [1] and one more link [2]

[2] http//link2 [1] http//link1

How can I add text in the last line?

share|improve this question
    
Even with the editing, I still don't understand what is being asked. It would be helpful to show what is supposed to be on the clipboard (I would guess one of the links, but it seems unlikely there could be two different links). I do notice that the two %filltext%s have the same name, so they will be forced to have the same value -- perhaps that is the problem? – Smilin Brian Dec 5 '12 at 4:20
    
Hi,sorry for this. the [1] and [2] came from two times adding :link. First one I add "1" and second "2" And the to times filltext is to add the same number in the text and at the bottom of the text. My question ist, how to add text on the last line of text. And it does no matter if there is text betweet. – Sebastian Thiele Dec 5 '12 at 8:26
1  
I think I finally understand what it is you want. At step one you have This is my text with a link [1]\r\r[1]link1 and then you want to type and one more link, then you want to end up with the text being as in your first example. Unfortunately I can't think of a good way to accomplish this with TextExpander. It does not know how to go down to the end of your document, possibly skipping over text like [1]link1, add [2]link2 then get back up to where you were typing before. – Smilin Brian Dec 9 '12 at 1:40
    
@SmilinBrian If we need not "get back up to where you were typing before", is it possible? – Eden Harder Dec 11 '15 at 8:50
    
It is possible but very complicated. You could have a snippet output a Markdown link, then launch a delayed-execution AppleScript app which could use keystroke commands to Command-Shift-Down-Arrow to get to the bottom of the text file, then keystroke "[" etc plus key Command-V to Paste in the link. – Smilin Brian Dec 11 '15 at 22:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.