Join – An Awesome Browser Plugin/Android App

Join is an app for Android that provides several functions. When used with the desktop app (Windows) or any desktop that supports the Chrome web browser, you can receive all of your phone’s notifications, share the clipboard, share files, and view/reply to SMS text messages.  The last item is probably the feature that is most used. Below is what the initial SMS notification pop up looks like in Chrome.

For the techies reading, Join also has a full API, Tasker, and IFTTT support. So the things you can do with it are only limited by your imagination.

Join has 30 day trial and after that a one time $4.99 payment.

Add PATH Environment Variable to launchd Scripts

Recently I was having an issue with Node.js not being detected in my PATH with a Python script executed by launchd. This was bizarre to me for a couple of reasons.

First, I’ve been using launchd for awhile now, and any LaunchAgents run under my profile usually has detected anything in my path, including Homebrew installed binaries.

Second, when testing the script via Terminal it worked perfectly.

After reading the available launchd keys, I discovered you can add an EnvironmentVariable with a list of your PATHs that will be executed before the ProgramArguments key.

It worked perfectly, and since it seems to be little used, I thought I’d post it here. Here is an example of the format you want to use in your launchd item:

 

Gatekeeper & App Translocation on macOS

This is a quick trinket to fix an issue with App Translocation and Gatekeeper.

Starting with 10.12 an App from outside the App Store when run from a disk image or the downloads folder, path translocation kicks in to protect the system and runs the app in a contained read-only environment.  At least from what I can understand from the documentation.

What is supposed to happen is when a user copies that app into the Applications folder (or really most anywhere else that is valid) and run again, Gatekeeper pops-up and asks if you’re really sure you want to run it because it’s from an unknown developer and that you need to visit System Preferences -> Security to Allow it.

Somewhere along the line, an attribute is set to turn off the quarantine for the read only mode and make the app behave normally.  For whatever reason, this sometimes fails causing the app to not be able to save files or even it’s own preferences.

To fix this, you can use the xattr command via the Terminal to manually remove the quarantine attribute like so:

Synctunes – iTunes to Android Music Sync

Synctunes is an app for Android with a desktop counterpart (macOS or Windows) that will let you sync your iTunes library, or selected playlists from an iTunes library to your Android device.

I looked at quite a few of these and settled on this one as it met all my requirements:

  1. Sync over wireless.
  2. Sync selected playlists.
  3. Use “standard” or custom locations on my android phone so that the native apps could find my media in expected location(s).
  4. Not be a service that is constantly running on my phone and consuming battery life.
  5. Sync all meta data like artwork, tracks, album and so on.
  6. Sync only changed/new tracks on subsequent syncs.

Synctunes does the job perfectly. Below are a few screen shots to show you how simple it is to use. The screenshots of the desktop app are for the macOS version, but the Windows version is nearly identical.

You’ll also note that I have SynctunesPro. The free version can sync up to 100 songs, but that gives you a good idea for testing its capabilities. As soon as I realized that it did what I wanted, I spent the $2.99 for the Pro app with unlimited sync. Money well spent considering the app is also “family sharing” enabled so everyone in the household can sync their own iTunes libraries too!

First, download the app and open it up. You can choose a location and see how many items are already on your device from any previous sync. It also gives you your Wifi information.

Open up the desktop app and you’ll see that it auto detects your device(s) in the right box. Just click to select it and then click connect.Select the playlist(s) you want, click Sync and off you go!You can watch the progress on your phone, complete with album art, as it syncs too! (Excuse the art mismatch with the actual sync metadata below. That’s me unable to get a screenshot during the sync that matched. My library is up-to-date and as it is scanning it is so fast the album information is literally “blink of an eye” quick! When it actually has something to transfer it appears as it should.)

Get Lyrical

I have a fairly huge iTunes music library and would consider myself a bit of a music buff, having music from almost every genre. I’m also particular about making sure my music is properly tagged with every field possible.

One of those possible tags you can include as part of the file metadata is the complete song lyrics. Get Lyrical is a little app that will do this for you. I prefer to let it just run in “Active tagging mode” and as each track is played in iTunes, if there are no lyrics for it yet, Get Lyrical will go out on the internet, find them, and write them into the file’s metadata automatically.Get Lyrical is free, but consider a donation.

Alexa, IFTTT, DropBox, and x10 Automation

This past Christmas we received an Amazon Echo as a gift. The Echo  is the smaller version of the full Alexa, just without the large speaker

If you’ve seen some of my posts here, I’ve been using x10 modules for a long time. Being on the thrifty-side, and not wanting to re-invest in a completely different home automation system, I set about getting the two to work together. In fact, you should probably read the above post first to see how I have x10 working with my server if you’re looking to do the below with macOS.

So, how do you bridge a modern voice control system like Alexa with home automation gear that was invented in 1975, but still sold today? Scripting, DropBox and a service called If This Then That (IFTTT).

I could write an entire blog post about IFTTT alone, but the short version is IFTTT can take input from one type of service or product and then do something with that input to a different service. For us, we’re going to take a voice command to Alexa, drop a text file into Dropbox that will trigger an event on our Server that hosts the x10 CM17A “Firecracker” interface to tell our modules what to do.  It sounds complicated, but it really isn’t and works like a charm!

Dropbox

Most everyone knows what Dropbox is, it’s an online cloud service that lets you synchronize files with your computer. We’re going to make a directory in our Dropbox to be used exclusively by this process. I simply called mine x10.

IFTTT

  1. Login to IFTTT and choose New Applet.
  2. Click +this and choose Amazon Alexa and then choose Say a Specific Phrase.
  3. I’m going to create one to power on our printer, which is downstairs and we often print to it from upstairs. This will save us a trip. So, I enter: printer on and click Create Trigger.
  4. Click +that, choose Dropbox and then choose Create a Text File.
  5. Erase the pre-filled File Name and just call it printeron, Content can be anything but must have something, so I just use x10, and for the Dropbox Folder Path just use your custom folder from above, in my case x10/
  6. Finally, click Create Action and then Finish. When you’re done, it should look like the image on the right.

If you wanted a companion Applet to turn the printer off, just repeat the above process with the trigger phrase printer off.

Scripting

All of the following referenced scripts are over at my GitHub repository. I’ll put them below for reference, but you might want to use the ones from GitHub as I’ll be updating those on a regular basis after this post goes live.

The first script is an x10 pre-handler I wrote because x10 modules can sometimes be stubborn and is what is called by my main script. It also does some custom notifications for the other x10 timed events I use:

You could just skip it and replace the calls to it in the below script with direct heyu commands too.

Now we need a launchd entry on my macOS Server to watch for changes and trigger the x10ifttt.sh script to turn modules on or off. You could easily mimic this with cron on Linux if that is your OS flavor.

Next, my IFTTT script (x10ifttt.sh) which is what the above launchd item triggers:

Putting it all together…

Our chain of events are as follows:

  1. I say “Alexa, trigger printer on”.
  2. Alexa hears this and sends IFTTT the command to create a txt file in my Dropbox at the path /x10/printeron.txt
  3. Using the lanuchd service, my server is monitoring that Dropbox directory on my server for changes. It sees a change and runs my x10ifttt.sh script.
  4. The script looks for files named a particular way and executes the x10 command if a matching one is found. In this case, it finds printeron.txt which tells it to send the command to turn module a3 on. It then removes the text file so it isn’t present the next time I send a command.

Closing thoughts:

  • You would think there might be a delay with all of this happening. To my delight, there isn’t much. The time of a spoken command to x10 module event is on average +/- 3 seconds. Heavy network traffic into your LAN might add a few seconds, but so far my command success rate has been 100% after two months.
  • At some point I plan to re-work this so that only one command will be needed eg: “trigger printer”. This will require some logic so that the script remembers the last state of the device (on or off). Unlike the newer automation boxes, there is no two-way communication with x10, and thus no way to retrieve the current state of the module.
  • You’re not limited to Dropbox. This could be easily changed with your choice of services: Google Drive, OneDrive, or something else so long as IFTTT supports the service.
  • This is just a working framework for macOS/Linux, you could also do this on Windows using a x10 program and Task Scheduler as a substitute to launchd’s “watch folder” process.