I want write ahk-script that helps type quickly html tags
i know the way
----
:*:a?::
SendInput <a href="" name=""></a>{Left, 14}
return
----
autoreplaces by <a href="" name=""></a>
but I need write tags with attributes
for example
"a ht?" => <a href="" target=""></a>
"i sa?" => <img src="" alt="">
"d ic?" => <div id="" class=""></div>
is it possible?
Thanks
p.s. Apologize for broken English

Quick Type HTML Tags
Started by
orehta
, Jul 10 2011 09:03 AM
7 replies to this topic
#1
-
Posted 10 July 2011 - 09:03 AM

Not an answer to your question but have a look at k-html
<!-- m -->http://www.autohotke... ... ight=khtml<!-- m -->
<!-- m -->http://www.autohotke... ... ight=khtml<!-- m -->
#2
-
Posted 10 July 2011 - 09:46 AM

Not an answer to your question but have a look at k-html
<!-- m -->http://www.autohotke... ... ight=khtml<!-- m -->
thanks, the program is wide-functional
but i search autoreplaces(not shortcuts), it is hard to keep in mind so many shortcuts.
i find hotstrings
<!-- m -->https://ahknet.autoh... ... trings.ahk<!-- m -->
can i adapt it for myself?
Any variants?
#3
-
Posted 10 July 2011 - 10:10 AM

No need you can use regular hotstrings
Edit: you could use hotstrings if you want to for greater flexibility <!-- m -->http://www.autohotke... ... =zencoding<!-- m -->
basic example (to adopt the entire style would require a much more complex script, I started it once but never finished it as I found it to be somewhat unreliable/unstable)
#Hotstring EndChars -()[]{}:;'"/\,.!`n`t ; see http://www.autohotkey.com/docs/Hotstrings.htm - I've removed space and ? as endchar :*:a ht?::<a href="" target=""></a>{left 6}
Edit: you could use hotstrings if you want to for greater flexibility <!-- m -->http://www.autohotke... ... =zencoding<!-- m -->
basic example (to adopt the entire style would require a much more complex script, I started it once but never finished it as I found it to be somewhat unreliable/unstable)
#SingleInstance, Force #Include hotstrings.ahk /* type p>b for example */ hotstrings("(\w+)>(\w+)\s", "ZenCode") Return ZenCode: a:=% $1 b:=% $2 code= ( <%A%> <%B%></%B%> </%A%> ) Clipboard:=Code Send ^v code= Return
#4
-
Posted 10 July 2011 - 10:18 AM

thanks, i think hotstrings is suitable. i hope i can prepare result string

#5
-
Posted 10 July 2011 - 10:38 AM

You can also use Appifyer (see my signature) with Pastej, atleast it's very nice to insert links and other self defined strings.
#6
-
Posted 10 July 2011 - 12:17 PM

Here's my solution:
:oc:href::<a href="^v"target="_blank"></a>{Left 4} :oc:<href>::<a href="^v"target="_blank"></a>{Left 4} :oc:<ul>::<ul>{Enter}{Enter}</ul>{Up} :oc:<ol>::<ol>{Enter}{Enter}</ol>{Up} :oc:<li>::<li></li>{Left 5} :oc:<co>::<code></code>{Left 7} :oc:<p>::<p></p>{Left 4} :oc:<bk>::<blockquote>^v</blockquote> :oc:img::<img src="^v"> :oc:<img>::<img src="^v"> :oc:<str>::<strong></strong>{Left 9} :oc:<b>::<b></b>{Left 4} ^!b::Send , ^c<b>^v</b> :oc:<i>::<i></i>{Left 4} ^!i::Send , ^c<i>^v</i> :oc:<u>::<u></u>{Left 4} ^!u::Send , ^c<u>^v</u> :oc:<em>::<em></em>{Left 5} :oc:<h1>::<h1></h1>{Left 5} :oc:<h2>::<h2></h2>{Left 5} :oc:<h3>::<h3></h3>{Left 5} :oc:<h4>::<h4></h4>{Left 5} :oc:<html>::<html>{Enter}{Enter}</html>{Up} :oc:<head>::<head>{Enter}{Enter}</head>{Up} :oc:<body>::<body>{Enter}{Enter}</body>{Up} :oc:br::<br> :oc:mailto::<a href="mailto:^v"></a>{Left 4} :oc:<div>::<div></div>{Left 6} :oc:cmt::<{!}-- -->{Left 4} :oc:hr::<hr> ; tables :oc:tab::<table>{Enter}{Enter}</table>{Up} :oc:tr::<tr>{Enter}{Enter}</tr>{Up} :oc:td::<td></td>{Left 5} :oc:skel::<html>{Enter}<head>{Enter}<title></title>{Enter}</head>{Enter}<body>{Enter}{Enter}</body>{Enter}</html> ReturnRemington
#7
-
Posted 10 July 2011 - 11:28 PM

Here's my solution:
:oc:href::<a href="^v"target="_blank"></a>{Left 4} :oc:<href>::<a href="^v"target="_blank"></a>{Left 4} :oc:<ul>::<ul>{Enter}{Enter}</ul>{Up} :oc:<ol>::<ol>{Enter}{Enter}</ol>{Up} :oc:<li>::<li></li>{Left 5} :oc:<co>::<code></code>{Left 7} :oc:<p>::<p></p>{Left 4} :oc:<bk>::<blockquote>^v</blockquote> :oc:img::<img src="^v"> :oc:<img>::<img src="^v"> :oc:<str>::<strong></strong>{Left 9} :oc:<b>::<b></b>{Left 4} ^!b::Send , ^c<b>^v</b> :oc:<i>::<i></i>{Left 4} ^!i::Send , ^c<i>^v</i> :oc:<u>::<u></u>{Left 4} ^!u::Send , ^c<u>^v</u> :oc:<em>::<em></em>{Left 5} :oc:<h1>::<h1></h1>{Left 5} :oc:<h2>::<h2></h2>{Left 5} :oc:<h3>::<h3></h3>{Left 5} :oc:<h4>::<h4></h4>{Left 5} :oc:<html>::<html>{Enter}{Enter}</html>{Up} :oc:<head>::<head>{Enter}{Enter}</head>{Up} :oc:<body>::<body>{Enter}{Enter}</body>{Up} :oc:br::<br> :oc:mailto::<a href="mailto:^v"></a>{Left 4} :oc:<div>::<div></div>{Left 6} :oc:cmt::<{!}-- -->{Left 4} :oc:hr::<hr> ; tables :oc:tab::<table>{Enter}{Enter}</table>{Up} :oc:tr::<tr>{Enter}{Enter}</tr>{Up} :oc:td::<td></td>{Left 5} :oc:skel::<html>{Enter}<head>{Enter}<title></title>{Enter}</head>{Enter}<body>{Enter}{Enter}</body>{Enter}</html> ReturnRemington
I would omit > in shortcut. Like so ...
:oc:<ul::<ul>{Enter}{Enter}</ul>{Up} :oc:<ol::<ol>{Enter}{Enter}</ol>{Up} etc
Also check out my "Intuitive CSS shortcuts":
<!-- m -->http://www.autohotke... ... 631#471631<!-- m -->
#8
-
Posted 04 September 2011 - 09:13 AM
