Archives
Admin / Logout

Adam Merrifield

a picture of me
I am a web designer, theme designer, professional photographer and internet personality. I make many pretty things and I write a lot of content for the internet.

I am one of those guys that, because of the industry I am in, need to be connected at all times. At any given moment you'll find me posting on a forum, updating with twitter, Digging things worthy of attention, uploading pictures, or tagging cool sites.

here i am

seyDoggy Systems:
This is home base, the corporate headquarters, the hub, if you will, seyDoggy.com.

seyDesign news:
these are the RapidWeaver related posts that originally appear in the seyDesign.com blog

Uploads from seyDoggy:
these are the pictures that I upload to flickr

Merrifield Photography:
as a professional photographer I my camera ready at Merrifield-Photography.com.

delicious.com/seydoggy:
these are the websites I want to share or revisit later on. I just tag them on delicious.com.

what i am

I am the owner and operator of seyDoggy Systems, a small theme, code and design outfit based in Kitchener, Ontario, Canada. We primarily develop web based technologies but have begun to dabble in the desktop realm.

what i do

I code like a fool. I design like a fool. I am happiest when I can split my time between the two (though I tire of Photoshop faster then I do TextMate or Terminal), and somehow I have managed to etch out a living doing so.

RapidWeaver Add-ons Version Identifier

RapidWeaver Add-ons Version IdentifierOne thing RapidWeaver does poorly — at this current moment — is help the end user determine the product version they are using on any given 3rd party add-on. Knowing your add-ons (theme or plugin) version number is critical when asking for support and is often one of the first things the developer will ask you for.

If you know where the add-ons are kept (~/Library/Application Support/RapidWeaver/) then you might be able to determine a plugin or themes version number with the Finder, or if you have RapidWeaver open you can find out a plugin’s version by opening the plugin browser, or if you show a themes package contents and…

Well, I like to have these sorts of things at my fingertips and do as little thinking as possible, so I wrote an AppleScript to gather this information for me no matter where I am or what I am doing*:

-- file types to choose from
set rwTypeArray to {"Theme", "Plugin"}

-- choose from those file types
set rwTypeLong to {choose from list rwTypeArray ¬
    with prompt "Which RapidWeaver product type ¬
        you like to find the version of?" ¬
    with title "Theme or Plugin"} as string

-- logic from result
if rwTypeLong is "Theme" then
    set rwType to "rwtheme"
else
    set rwType to "rwplugin"
end if

-- get name of hard drive
tell application "System Events"
    set diskName to (get name of startup disk) as string
end tell

-- get name of user
set userName to (do shell script "whoami") as string

-- select file from RW directory
tell application "Finder"
    set rwFile to (choose file with prompt ¬
        "Please select your RapidWeaver " & rwTypeLong & ":" ¬
        default location (diskName & ":Users:" & userName & ¬
            ":Library:Application Support:RapidWeaver" as alias) ¬
        of type rwType without invisibles)

    -- read version number
    tell application "System Events"
        set rwInfo to (get version of the file (rwFile as string))
    end tell

    -- and display it
    if rwInfo = "" then
        display dialog ¬
            "It seems that your " & rwTypeLong & ¬
                " doesn't have a version number that I can read. ¬
                Sorry.\n\n¬
                Would you like me to reveal it's ¬
                package contents for you?" ¬
            buttons {"Cancel", "Yes"} default button (2)
        set rwPath to rwFile & "Contents" as text
        open rwPath
    else
        display dialog "The version information:\n\n" & rwInfo & ¬
            "\n\n ...has been copied to your clipboard." ¬
        buttons {"OK"} default button (1)
        -- copy to clipboard
        set the clipboard to rwInfo

    end if
end tell

Notes

* If a theme is to have it’s version number read, it must have an Info.plist in it’s package contents. Some theme developers do not include this file. For those that don’t, the script will reveal the theme’s package contents so that you can inspect the version number at the bottom of the Theme.plist file

Download

Get your fresh copy of RapidWeaver_Addons_version.scpt from CodeCollector.net

Comments (1) | Trackback

Creating Unique ID's For… Anything!

There are numerous reasons you might need a unique identifier on something; you upload files with common names to the same ftp site, you use the id attribute for internal links on a blog that might display multiple posts (the chances of repeating yourself are good), you want to sign your emails with a unique, one time id for your own verification… Whatever the case, a unique id could come in handy.

The easiest thing to do is use a timestamp and a shell script can do that easily enough for us. For everyday use, the year, month, day, hour, minutes and seconds should suffice (unless you need multiple unique id’s per second). Here is how the bash script would look:

date +%y%m%d%H%M%S

Entering this string into the Terminal.app would yield a twelve digit number like this:

091027191546

The first pair of digits is the year, the second pair is the month, the third pair is the day, then the hour, minutes and seconds (all in pairs). Run this script in Terminal.app as many times as you like and you will never get the same number.

So you could enter this into your terminal every time you wanted a unique id… or you could make this shell script work for you from anywhere.

TextMate Snippet

TextMate Snippet for Unique ID TextMate makes running shell scripts dead easy — all you need to do is create your own snippet. To do this:

  • open your Bundle editor — Bundles > Bundle Editor > Show Bundle Editor or ⌃⌥⌘B
  • create a new bundle (if you don’t already have your own) from the + icon
  • within that bundle create a new snippet from the + icon
  • in the edit window, type:

    `date +%y%m%d%H%M%S`
    
  • define a Tab Trigger or Key Equivalent
  • leave the scope selector blank to have the snippet apply to all language types

Now you have a snippet that is accessible in any language scope you use TextMate for. This is handy if you write reference links in HTML articles, such as:

<a href="#note_091027194043">See this note</a>
<div id="note_091027194043">
    This is the special note I wanted you to see.
</div>

Or for reference style links in MarkDown:

Check out our site, [seyDoggy][a_091027194631], for some
really cool tips and tricks.

[a_091027194631]: http://www.seydoggy.com/  "seyDoggy's really cool site"

Download

Download your fresh copy of “Unique ID.tmSnippet” from seyDoggy.com.

AppleScript to clipboard

UniqueID AppleScript for creating unique id'sSay you’re not a TextMate user but you still want a quick way to run this shell script with as little effort as possible. AppleScript makes quick work of this task with it’s do shell script functionality. We need to make an AppleScript that runs the shell script, then copies the results to the clipboard. Then we can paste that result into what ever we’re working with at the time; file renaming, email signing, etc…

Here is how the script looks:

set uniqueID to (do shell script "date +%y%m%d%H%M%S")
set the clipboard to uniqueID
display alert "\"" & uniqueID & "\"" & "Has been copied to your ¬
    clipboard" giving up after 1

Download

Get your fresh copy of “UniqueID.scpt” from CodeCollector.net

Comments (1) | Trackback

One of My Old Favorites All Fresh and New

The postman just delivered my fresh copy of Build Your Own Database Driven Web Site Using PHP & MYSQL, 4th Edition. It’s not that there was anything wrong with my previous copy, but it was getting a little dated. Plus I am a little nostalgic for this particular publication.

With a quick glance I can already see that the book has been restructured quite a bit moving chapters around. I am really looking forward to reading this book again with renewed purpose and updated perspectives.

No comments | Trackback

The Little Know Clipboard App That Can

Jumpcut makes copy and pasting easyOne thing the Mac OS has repeatedly failed at is a native clip board, one where more then the most recent item is available to you. This has been an ongoing concern of mine for quite some time and I have always been on the lookout for a solution… a good solution.

Back in the spring of 2007 I wrote about iClip as one possible solution and in fact my dependency on it around that time became so great that I was using it to store passwords, code snippets, oft used text, etc… All was great until one day, the database became corrupted. Yes, iClip was complex enough that is was storing all my clipboard data, snippets and what not, in a database. Eeeeek!

My next notable shift in clipboard management was QuickSilver, for which I have written numerous articles. For everything that I used iClip for I was able to use QuickSilvers “Shelf” and “Clipboard History”. It was a brilliant setup and had them show/hide off the edge of the screen with a couple hot-keys. Then came the inevitable fall of QuickSilver. I can’t afford to keep monkeying around with sub-alpha builds of various branches so after my nearly three year dependency on QuickSilver I had to finally give it up.

The hole that was left was quickly filled with apps that I already use on a daily basis, like Code Collector Pro which bore the brunt of my oft used text snippets and auto complete tasks. But I was still left without a good solution for clip board history. So off on a mad search I went, review countless apps that varied in complexity and price range, until I came upon a small, simple, unobtrusive app that does one thing; buffers your clipboard history. Jumpcut is a simple, open source (and free) clip board history manager that allows you easy access to your clipboard history with a few simple key strokes.

Jumpcut allows you to set up the size of your buffer size (up to 99 clips), hot keys, bezel behaviour, app behaviour and that’s about it. It doesn’t get any simpler to use or set up. I have been using this little app heavily on a daily basis since February and never once has it failed me. No hang ups, it’s never lost my history, it’s never crashed or caused anything else to crash. It’s lightweight, responsive and just an overall pleasure to use.

This is the app that ought to be a part of Mac OS X.

Comments (2) | Trackback
Powered by RapidWeaver, WP-Blog and WordPress 2.9.2