11 Jul

A quick entry journal, daily log script using Launchy

I have a colleague who keeps a meticulous log of most things he does throughout the day. Whether it is a simple work complete, phone call, task, he writes it all down in tiny handwriting into this notebook he keeps by his side. I’ve always been jealous of that setup, but have never been the pen and paper guy. Or more correctly have stopped being the pen and paper guy for a long time. Plus, I like my data to be searchable, indexable, filterable, you get the idea.

I tried to find to find a software that might do the trick, but the majority were time tracking software that required more than my simple needs.

All I wanted was the ability to quickly add to a text file in the background. If I thought of something, I’d press a key, start typing, and another key and that was it.

I’m an avid Launchy user. If you don’t know what it is I suggest you check the website and read up on it. Besides its basic usage, which is launching programs, I use it to search for files (using everything), start emails, tasks, as a basic calculator and more.

So after no luck finding what I needed, I decided to see if I could do it myself.

I knew what I wanted was basic, but when you are not a programmer, not everything comes easy!

 

So, knowing you can append to files using the command line, and knowing I could pass arguments to a batch file using Launchy, I came up with the following.

Hope it helps you and I hope you find Launchy useful for more than just this.

Keep in mind this is for Windows, but once you see how it works, it should be pretty easy to adapt to other platforms too.

  1. Download and install Launchy – https://launchy.net/download.php#windows
  2. Create a batch file called mylog.bat under C:\Temp and paste the following.:: Output example: 2018/07/07 Sat 10:53:19 "Entered note"
    ECHO %date:~10,4%/%date:~7,2%/%date:~4,2% %date:~0,3% %TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2% %1>>"C:\Temp\mylog.txt"

    For testing purposes, I am using C:\Temp in this “tutorial”. Change the location and the name of the mylog.txt and the batch file to what you want.
  3. In Launchy,
    • right-click and choose Options
    • Choose the Plugins tab and then Runner
    • Hit the + button and enter mylog for name C:\Windows\System32\cmd.exe for program and /c C:\Temp\mylog.bat "$$" for the arguments and hit OK.
      Again, feel free to change mylog and mylog.bat to whatever you want to call it. Just to be safe, hit F5 after you are done so Launchy refreshes it’s database and options.
    • That’s it. Now, simply Alt+Space to launch Launchy. Type mlog {tab} enter some text, hit enter and voila! Open your mylog.txt file to confirm your text is there and enjoy!

From there, you can open the tab delimited text file in Excel and filter by date, export to other formats or whatever!

Some things to note,

  • the date format is based on your PCs language and region settings, if it doesn’t look right, use your Google-fu to edit the batch file and make it work for you!
  • There’s no need to have the .txt file open. It’s just here so you have an idea
  • Save your text file in your Dropbox or Google Drive folder so not only do you have backups, but you can set up multiple computers to work in this manner.
  • Launchy remembers how you launch shortcuts. If you pay attention at the animation below, you will see that by the third try I am simply pressing m and then tab as Launchy has now associated m with the mylog command.

 

24 Oct

Automatically launch Spotify playlist and start playing on shuffle

At work, we needed a quick and dirty way to start playing our office playlist. Because there were three people, it needed to be as simple as possible. So, I ended up with the following shortcut assigned to a dedicated button on my Logitech G13 with the joystick mapped to volume up/down and mute. Works a treat.

Here’s how:

  • Make sure you are targeting the right page, tick on “enable cjs for this host” and paste the following code (remember to change !!!yourplaylistid!!! to your… you guessed it!)
$("document").ready(function() {
  if(window.location.href.indexOf("!!!yourplaylistid!!!") > -1) { // change the ID to restrict the script to only run on the playlist you choose
    setTimeout(function() { // wait 5 seconds to finish page load and simulate clicking on the shuffle button
      $('.spoticon-shuffle-16').trigger('click');
    },5000);
    setTimeout(function() { // 2 seconds later, simulate pressing the next button to play a 'random' song
      $('.spoticon-skip-forward-16').trigger('click');
    },7000);
  }
});

From now on, every time you launch your SuperAwesomePlaylist shortcut it will go right into your chosen playlist, start playing on shuffle and skip to the next song, just so it doesn’t start off with playing the same song on each launch!

And now that you have your shortcut file, you can launch it in interesting ways:

  • Copy it to Windows start-up so everytime your PC loads it starts playing your music
  • Using the Bluetooth Proximity Lock app, start your playlist as soon as your phone connects
20 Jul

Launchy skin for high-dpi displays (ala Surface Pro)

I’m probably one of the few who is still loyal to Launchy. I’ve tried alternatives like Hain and Wox, but keep coming back to it.

If you gasped at how tiny the default skins come up, fret no more! The following skin will work perfectly with any high dpi display and not necessarily just the Surface Pro.

Download here.

Don’t know what to do with it? Simply extract the zip file to your Launchy skins folder (typically C:\Program Files (x86)\Launchy\skins)