<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dr. House</title>
    <description>The latest articles on DEV Community by Dr. House (@drhouse).</description>
    <link>https://dev.to/drhouse</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F285243%2F489b8f99-dbd9-4bed-ac26-ef2a35af6eb2.png</url>
      <title>DEV Community: Dr. House</title>
      <link>https://dev.to/drhouse</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/drhouse"/>
    <language>en</language>
    <item>
      <title>[utility script] functionally replace Devtools 'Copy JS path' with 'Copy jQuery path'
</title>
      <dc:creator>Dr. House</dc:creator>
      <pubDate>Mon, 23 Nov 2020 06:20:02 +0000</pubDate>
      <link>https://dev.to/drhouse/utility-script-functionally-replace-devtools-copy-js-path-with-copy-jquery-path-3nab</link>
      <guid>https://dev.to/drhouse/utility-script-functionally-replace-devtools-copy-js-path-with-copy-jquery-path-3nab</guid>
      <description>&lt;p&gt;When working with jQuery on webpages, I regularly use the Devtools context menu option 'Copy JS path', this produces something like:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;document.querySelector('element1 &amp;gt; element2')&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then I always need to replace &lt;code&gt;'document.querySelector'&lt;/code&gt; with a &lt;code&gt;'$'&lt;/code&gt; for jQuery to work... so tedious!&lt;/p&gt;

&lt;p&gt;I wrote a small Autohotkey utility script which detects &lt;code&gt;'document.querySelector'&lt;/code&gt; when in the clipboard and automatically replaces it with a &lt;code&gt;'$'&lt;/code&gt; - it's very simple and effective.&lt;/p&gt;

&lt;p&gt;install Authotkey, save as 'clippie.ahk' (for example):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;#Persistent&lt;/code&gt;&lt;br&gt;
&lt;code&gt;OnClipboardChange("ClipChanged")&lt;/code&gt;&lt;br&gt;
&lt;code&gt;return&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ClipChanged(Type) {&lt;/code&gt;&lt;br&gt;
    &lt;code&gt;StringReplace, clipboard, clipboard, document.querySelector,&lt;/code&gt; &lt;code&gt;$, All&lt;/code&gt;&lt;br&gt;
&lt;code&gt;}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(minor note: if you ever need to copy/paste '&lt;em&gt;&lt;code&gt;document.querySelector&lt;/code&gt;&lt;/em&gt;', just copy/paste '&lt;em&gt;&lt;code&gt;document.querySelecto&lt;/code&gt;&lt;/em&gt;' and then manually add '&lt;em&gt;&lt;code&gt;r&lt;/code&gt;&lt;/em&gt;' at the end)&lt;/p&gt;

&lt;p&gt;Or, if you're brave, I compiled the script into an .exe you can download:&lt;br&gt;
&lt;a href="http://www.mediafire.com/file/c4ncvvhrurvzwig/clippie.exe/file"&gt;clippie - Copy jQuery path&lt;/a&gt;&lt;/p&gt;

</description>
      <category>jquery</category>
      <category>stringmanipulation</category>
      <category>devtools</category>
      <category>copypaste</category>
    </item>
  </channel>
</rss>
