Automator Script to copy photos from iCloud PhotoStream into Lightoom

Background

iCloud Photo Stream is limited to a copy of the last 1000 photos, and 30 days or something.
Camera roll is everything, unless you delete something.
Camera roll is backed up to the iCloud as part of the phone backup

Automatically import photo stream photos into Lightroom:
These instructions didn’t work for me, because the Filter Finder Items wasn’t returning all the images, only the last one

These instructions worked, and in case they go away, here they are:

Preview

This link talks about how to get a notification for the automator action, which I integrated into my recipe, which now looks like this:

Preview

BTW: I got this image from the automator package, which is located here:  /Users/jake/Library/Workflows/Applications/Folder Actions/

The upside-down text is weird. Here it is copy and pasted:

on run {input, parameters}
    repeat with i from 1 to the count of input
        set thisItem to item i of input
        set thisPath to the quoted form of the POSIX path of thisItem
        set thisFilename to (do shell script "basename " & thisPath)
        if i is 1 then
            set the nameString to thisFilename
        else
            set the nameString to nameString & ", " & thisFilename
        end if
    end repeat
    return nameString
end run

Which results in this:

automator notifications

It would be cool to be able to include a thumbnail of the image in the notification…

I’ve been running this script for a while now, and it seems to be working nicely on Mavericks 10.9.5.

The next part will be configuring Lightroom to automatically import from that directory.

But what to do about Dropbox? Keep it as is, automatically importing photos?

And then what is the easiest way to get rid of photos from the Camera Roll?

Bringing Sanity to Multilevel Headings in Word

I do Word good. I like making documents look good, and I do things like clean up styles when I’m working with a group on a document. I even suggested to my team once that they should just send me their copy in plain text, so I wouldn’t have to deal with their crap styles. I once had got a document that had defined all the Body Text and Headings as custom styles, which of course breaks the Table of Contents, and so the ToC was hand built. I shudder now at the memory.

Using headings in word is easy. Adding numbering to those is not. Word doesn’t make it easy with their menu design. Things like, there is no “modify” in the multi-level list drop down menu, only “Add New”. But I don’t want to “add new” I want to “modify”.

Anyway, this guy has a write-up that reveals the secret! You assign the style to list from the list configuration, not the other way around.

Simple, when you know how.

 

Mass set Categories Plugin Works For Me.

I’ve never used Categories before, and so every post was in the “Unfiled” category. I needed a way to bulk edit categories.

Seems that in WP4.0 you can bulk add posts to categories, but you cannot bulk remove categories from posts.

The Mass Set Categories plugin, and a little but of magic code, did the trick.

In case the magic bit of code (which was found in a user review, of all places) is lost, I’ve captured it here.

Open Mass set Categories in WP Admin, and then run following code in Console: jQuery("input[name$=\\[1\\]").attr("checked", false)

This allows you to tick the box for each post listed on the Mass Set Categories output page. In other words, the perfect way to remove a category for every single post all at once.

If you wanted to remove from only a selection of posts, this is not for you.

 

Things I’ve learned on the Mac so far

I bought a 27 inch iMac last year, and I’ve been trying to get used to it ever since.

Here’s what I’ve figured out so far:

  • There is no “cut” feature in Finder, only “copy”. To get “cut” you must first “copy” and then when you are ready to “paste”, hold down the “option” key, and the “copy” turns into “move”.
  • Install XtraFinder. It adds the following features to Finder
    • Multiple Tabs
    • Options to arrange folders on top of files
    • “Copy Path”, “Show Hidden Items”, “Refresh”, “Copy to”, “Move to”, “New Terminal Here”, “Make Symbolic Link”, “Contents”, …
  • Install DoubleCommand to make the “home” and “end” buttons on the keyboard work properly. Be sure to uncheck the “Enter Key acts as Command Key” or else the Enter key on the numeric keyboard will appear to stop working.
  • To make the forward delete key work properly in the terminal, edit the current Terminal profile, go to Keyboard, and look for the forward delete symbol. If it’s not there, add a new mapping. Select “Send Text” as the action, and then press ⌃-⇧-D (Control-Shift-D) in the input box. it will record it is \004. You are now good to go.
  • Any keyboard shortcuts you’ve defined on your iPhone will sync to the Mac, assuming you’ve got iCloud enabled. Except that these shortcuts don’t work in Chrome because they’ve opted not to use the MacOS spell-check thingy.
  • The Solarized project has a great colour scheme, and they have the setting for the Mac Terminal program, which is nice.
  • I use PureText on Windows to paste from the clipboard in plain text. On the Mac, you can get the same effect by using ⌥-⌘-V (Option-Command-V).

(Handy page with Unicode HTML entities for Apple key caps)

The Blackberry death spiral continues

One of the most popular travel apps, Worldmate, recently announced it has “teamed up with Blackberry” to produce a travel app. Tried to install it on the brand new Curve from work, and it failed. A brief search shows that the new travel app wont work for those using a Blackberry Enterprise Server (BES), which is, I don’t know, MOST OF THE USERS.

Web::Scrape with XPath and the dangers of Chrome

My first time submitting a question to Stackoverflow – what a great site!

I’d already written the SNMP discovery tool, which I was pretty proud of.  But, there was still some information that was only available by logging into the device’s web interface, use basic auth to get in, navigate to a page, and get 2 strings, then navigate to 5 other pages, getting the same two strings.

Sounds like a job for a script!

Everything was going well, decided to use Web::Scraper, wrote my program, and then … nothing.  It wouldn’t work, and I didn’t know enough about XPATH to even know where to start.  Plus, the Web::Scraper module was a bit scary to read.

Long story short, the XPATH being returned by Chrome was incorrect.  In the developer tools, right click on an element in the elements window and select “copy Xpath”.  What you might not know is that Chrome inserts HTML elements into the DOM that aren’t in the source HTML.  In my case, it was for extra <tbody> elements inside tables.

Oh, and learning the XPATH syntax helped too!

Excel: Combine Cells in Selection

Often when responding to RFPs, I find myself copying and pasting out of PDFs into excel to create Table of Compliance. This often results in some donkey-work that people might find familiar: deleting the header and footer for every page, and sorting all the lines into cells. Problem is, copy and paste from a PDF reader includes a CR/LF at the end of every line, which means your long sentence or paragraph gets pasted into several cells.

Copy and paste from a PDF and sentences will be split into rows

This macro (which I have on a button in the ribbon) will combine all the selected cells into a single text string, and place it in the upper-left-most cell in the selection.

First, select the rows the merge:

Select the rows to merge

Second, run the macro:

Run the Macro. I have it located on the main tab of the ribbon

Third, delete the rows left behind. I toyed with the idea of deleting these rows right in the macro, but opted to leave them alone. If I did delete them, then you’d still have to remove them, and I certainly didn’t want to do that in the macro, in case you were merging cells in amongst other cells.

Delete the remaining rows

Finally, apply some word wrap, resize the dimensions, and voila!

Resize and Word Wrap

Here is the script. All suggestions, comments and corrections welcome.

Function ConcatinateAllCellValuesInRange(sourceRange As Excel.Range, seperator As String) As String
    Dim finalValue As String

    Dim cell As Excel.Range

    For Each cell In sourceRange.Cells
        finalValue = finalValue + seperator + CStr(cell.Value)
    Next cell

    ConcatinateAllCellValuesInRange = Trim(finalValue)
End Function

Sub CombineCellsInSelection()
    Dim ActSheet As Worksheet
    Dim SelRange As Range
    Dim finalValue As String
    Dim destination As Excel.Range

    Set ActSheet = ActiveSheet
    Set SelRange = Selection

    finalValue = ConcatinateAllCellValuesInRange(SelRange, " ")
    SelRange(1, 1).Value = finalValue

End Sub

“Repairing” an amplifier from an Ex-CBC Editing Suite

CBC Radio got rid of a bunch of hardware from a couple of their editing suites from their studios in Calgary.  I heard about it when I was at Inner Sleeve, a store I’ve recently discovered when Lisa told me that they got a hold of the the CBC Calgary vinyl collection.  What I didn’t know was that they took a bunch of the hardware as well.

The amp is a Sony TA-1055 amplifier, and a set of Dynaco A25 monitor speakers, all with CBC Radio Canada asset stickers, which I think is super cool.

It’s old gear, but it sounds fantastic.

It started to drop the right input from the turntable, and I finally opened it up to have a look.

Woah – wire wrap.  Haven’t seen that since university.

In general, the problem was that the input source selection buttons are wired up weird, and that the other switches on the font actually route input signal through them when not selected. Wiggling them fixed the issue,  so “repair” is perhaps overstating what actually happened.

Damn I hate mechanical switches, they eventually fail intermittently, and send such a horrible crunch when they are usednad I have to remember to mute the volume when using them.

In general, it was a satisfying task.  It’s been a long time since I’ve taken apart an appliance!

The Latest Version of Blackberry Desktop Software Broke Outlook Syncing

RIM have gone and “updated” their desktop software, and they have “updated” it good and proper this time.

They have taken a functional PIM synchronisation tool, and completely broken it.  Worse, the previous version didn’t need fixing.  They’ve not added a single new feature, only bugs.  So many bugs, that it prompted this blog entry, and a downgrade to their previous version.

Lets take a look at the brokeness.

Redemption. How apt. And the lack of it quite ironic.

It starts with this wonderfully ironic error message.  Redemption appears to be a third party library to enable better access to Outlook data.  However, “redemption” is defined thus:

re·demp·tion [ri-demp-shuhn]
noun
1. an act of redeeming or the state of being redeemed.
2. deliverance; rescue.
3. Theology . deliverance from sin; salvation.
4. atonement for guilt.
5. repurchase, as of something sold.

Is RIM is atoning for the complete lack of QA? Or is it hoping for deliverance from a slow and painful corporate death, by releasing suicide software that everyone will hate? (mind you, iTunes is not that much better).

When all else fails, exit the program and announce that you’re done. Computer Science 101.

Syncing with Outlook data, while Outlook is running, doesn’t work.  You don’t know that though, because when it fails, you get the above dialogue. Configuring Outlook sync with Outlook running also doesn’t work.  You must close Outlook anytime you want to view or modify any settings, or indeed sync any data.  This resulted in the following sequence:

  • Try to configure Outlook settings
  • Discover that it can’t see any Outlook profiles.
  • Swear
  • Close Outlook
  • Restart the BB desktop software
  • Try to configure Outlook settings
  • Select the only Outlook profile configured on the machine
  • Configure the sync
  • (… time passes …)
  • Start Outlook
  • Try to configure Outlook settings in BB desktop software
  • All the settings are gone
  • Swear

That actually happened.

Conflict resolution screen.
Conflict resolution, with “Entry Updated” being the only clue
Conflict detail screen with no details.
Conflict details screen with no more details than what was shown on the previous screen. Lack of context makes it hard to know which entry to choose.

Now we come to the crux of the problem.  There are so many things wrong with these screens.  Here are some:

  • No feedback as to which entry you are modifying
  • Name column is fixed, and no way to change it.  Too bad if you have contacts with long names that all start similarly.
  • Since I didn’t trust the data I was being shown but still wanted to sync and eliminate conflicts, I wanted to copy some of the information to the clipboard in case I lost it.  Nope.  None of the text is selectable on any of these screens.
  • If a contact entry has been modified in two places at the same time, there is a chance that you will want to keep some fields from one edit, and other fields from another edit.  You know, merging.  Nope.  Not only can you not select fields from either side to merge, but no other fields are shown.  This lack of context means it’s very hard to know which copy you should take.
Finally, a screen that shows some context about the conflicting entries. But you can’t go back to correct anything!

Once you taken the plunge and  guess which entries to choose, you are presented with this screen, which looks more like the first screen in the conflict resolution process from the previous version of the software.

From here, you click on the information button, and you get a popup that contains the entire record, and highlights what has changed. This is much better, but it should have been the first screen you see, not the last.  At this point, having all that contextual information is useless, because you can’t go back and adjust your choices.  From here, you can cancel, and start all over again.

Lots of people are having problems with this version, many of them far worse than my gripes.  In some cases, the software crashes or hangs, and doesn’t work at all.  I came across this thread at Crackberry.  In it, they point to this link to download the previous version, which I plan to do. Update: That link is reportedly broken.

I’ve been saying for some time now, that I don’t understand it when people say they love their Blackberry.  To me, that is like saying you love your stapler.  And when my stapler starts to piss me off, I throw it away.   Unfortunately this is not my Blackberry.