<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:iweb="http://www.apple.com/iweb" version="2.0">
  <channel>
    <title></title>
    <link>http://www.jimmcgowan.net/Site/Blog/Blog.html</link>
    <description> </description>
    <generator>iWeb 2.0.2</generator>
    <item>
      <title>Adding a Menu to an NSButton</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/27_Adding_a_Menu_to_an_NSButton.html</link>
      <guid isPermaLink="false">4af06048-404d-4cfe-a46f-211ef67d6cd3</guid>
      <pubDate>Mon, 27 Aug 2007 18:33:18 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/27_Adding_a_Menu_to_an_NSButton_files/CustomPullDown_1.jpg&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/CustomPullDown_1.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:208px; height:161px;&quot;/&gt;&lt;/a&gt;Loads of apps now have little 'Action' buttons or the like that show a popup/pull down menu.  Unfortunately, NSPopUpButtons, when set to pull down draw there own little arrow in the corner, which can look pretty ugly if you are using the button borderless, or using your own image for a custom button.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;I've read a couple of articles online talking about attaching menus to NSButtons, but I didn't really like the solutions, which involved things like hidden NSPopUpButtons, or just didn't behave too nicely.  So here's my solution, using an NSButton subclass.  I'm not saying its better, but it's more to my taste :-)&lt;br/&gt;&lt;br/&gt;First up, create files for an NSButton subclass.  Add an IBOutlet for an NSMenu item, called something like popUpMenu.  (You could use the button's 'menu' outlet that it inherits from NSView, which is used for contextual menus, but I thought it was cleaner to have a separate outlet).  Second, add a NSPopUpButtonCell instance variable that will be responsible for showing the menu.&lt;br/&gt;&lt;br/&gt;In the implementation, add an awakeFromNib method and instantiate the cell, then set it's menu to the new outlet.  To have the button change state, dependent on whether the menu is being shown, we also need to register for the notification that the menu has closed:&lt;br/&gt;&lt;br/&gt;- (void)awakeFromNib&lt;br/&gt;{&lt;br/&gt;    popUpCell = [[NSPopUpButtonCell alloc] initTextCell:@&quot;&quot; pullsDown:YES];&lt;br/&gt;    [popUpCell setMenu:popUpMenu];&lt;br/&gt;&lt;br/&gt;	[[NSNotificationCenter defaultCenter] addObserver:self&lt;br/&gt;											 selector:@selector(menuClosed:)&lt;br/&gt;												 name:NSMenuDidEndTrackingNotification&lt;br/&gt;											   object:popUpMenu];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Next, override the mouseDown: method.  Here we want to set the button to it's highlighted state, then show the menu:&lt;br/&gt;&lt;br/&gt;- (void)mouseDown:(NSEvent *)theEvent&lt;br/&gt;{&lt;br/&gt;	[self highlight:YES];&lt;br/&gt;	[popUpCell performClickWithFrame:[self bounds] inView:self];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;The Apple documentation recommends using the attachPopUpWithFrame:inView: method, but I couldn't get this to work, so I used performClickWithFrame:inView: method instead.&lt;br/&gt;&lt;br/&gt;To set the button back to its non-highlight state when the menu closes, implement the menuClosed: method we noted when registering for the NSMenuDidEndTrackingNotification notification:&lt;br/&gt;&lt;br/&gt;- (void)menuClosed:(NSNotification *)note&lt;br/&gt;{&lt;br/&gt;	[self highlight:NO];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;And then, of course, clean up:&lt;br/&gt;&lt;br/&gt;- (void)dealloc&lt;br/&gt;{&lt;br/&gt;	[[NSNotificationCenter defaultCenter] removeObserver:self&lt;br/&gt;								name:NSMenuDidEndTrackingNotification&lt;br/&gt;												  object:popUpMenu];&lt;br/&gt;	[popUpCell release];&lt;br/&gt;	[super dealloc];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Switching to Interface Builder, drag an NSMenu into your nib and set it up with the items you want in the popup.  Add an extra item at the top of the menu with a blank title.  This is needed because we set our NSPopUpButtonCell instance to 'pulls down'.  A pull down menu does not display the top menu item - I believe the top button is used for the pull down button label.  Add an NSButton to your interface.  Drag the header for you NSButton subclass to the nib and set your NSButton instance's class to your subclass.  Hook the popUpMenu outlet to the menu you created and you should be good to go.</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/27_Adding_a_Menu_to_an_NSButton_files/CustomPullDown_1.jpg" length="12400" type="image/jpeg"/>
    </item>
    <item>
      <title>Apple Store Glasgow Opens</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/26_Apple_Store_Glasgow_Opens.html</link>
      <guid isPermaLink="false">9e76cf6c-1df1-43f8-8307-a45afc88d9fc</guid>
      <pubDate>Sun, 26 Aug 2007 20:51:47 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/26_Apple_Store_Glasgow_Opens_files/Apple%20Bag_1.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/Apple%20Bag_1.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:217px; height:173px;&quot;/&gt;&lt;/a&gt;Yesterday Gillian &amp;amp; I went to the ‘Grand Opening’ of the new &lt;a href=&quot;http://www.apple.com/uk/retail/buchananstreet/week/20070826.html&quot;&gt;Apple store on Buchanan Street&lt;/a&gt; in Glasgow.&lt;br/&gt;&lt;br/&gt;Some of the guys from the &lt;a href=&quot;http://www.glasmug.com/&quot;&gt;Glasgow Mac Users Group&lt;/a&gt; had been queuing from midnight, others turning up at 5am - there had even been 4 guys camped out from 7am on Friday.  We turned up at about 8.50am and the queue was fairly long.  I’m rubbish at guessing numbers (miby about 100-200?) but I was pretty sure we would still be OK for one of the 1500 free t-shirts at 8.50, &amp;amp; I was right!&lt;br/&gt;&lt;br/&gt;Just before the store opened at 9am, the staff, kitted out in black Apple t-shirts and kilts, came out at gave the queue a round of applause and a cheer.  Then there was a count down and the doors opened at 9am.  The staff were lined up either side of the door to welcome everyone in, give them a cheer and a free t-shirt.  It was a really nice welcome &amp;amp; the place had a great atmosphere all the time we were there.  Security were letting the crowd in a few at a time, Gillian and I got through the doors at 9.30.  By that time we had already seen a few folk leaving the store with new computers!&lt;br/&gt;&lt;br/&gt;The store is really nice inside.  The front and side wall are back to the stone work and have been cleaned/restored &amp;amp; look really good.  The others walls, floor and ceiling are all white or steel, and there is a stunning glass spiral staircase to one side, illuminated by LEDs in the floor beneath it.&lt;br/&gt;&lt;br/&gt;We had a look around.  The new iMacs are really stunning - they make the last model look stone age by comparison.  We had a play with some iPod stuff,  tried out the new keyboards and had a quick look at some of the new software.  We ended up buying iLife ’08, iWork ’08 and one of the new wired keyboards (which I’m writing on now, it is great to use &amp;amp; look totally space age!).  Actually, load of people seemed to be buying the keyboards &amp;amp; I noticed the staff having to replenish the stock on the shelf - at 9.45 am!!&lt;br/&gt;&lt;br/&gt;There seemed to be a lot of computers being sold as well.  As we were making our way upstairs we noticed a guy at the till with 2 white Mac Books, a black Mac Book and an iMac!  There are only two tills in the shop, which I thought was a little strange until we realized you don’t need to go to a till to buy something - all the staff have a piece of kit on their belt that is a combined barcode scanner/credit card processor.  They just scan what you want to buy, you punch in your PIN &amp;amp; that’s it!  If you’ve bought from Apple with that card before, all your details pop up on screen - if not you enter your email address.  Your receipt gets emailed to you!&lt;br/&gt;&lt;br/&gt;It is going to be really handy having a local Apple store.  Not just for Mac stuff either, the stock good makes and models of hard drive, optical drives, accessories, etc., which you just can’t get at PC world, &amp;amp; I’ve previously had to order online.  The events and workshops look good to, even Gillian is planning on going to one on photography :-)</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/26_Apple_Store_Glasgow_Opens_files/Apple%20Bag_1.png" length="117572" type="image/png"/>
    </item>
    <item>
      <title>Back From Canada</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/20_Back_From_Canada.html</link>
      <guid isPermaLink="false">8d4d5622-4a83-4556-bfbf-699762ddf8dc</guid>
      <pubDate>Mon, 20 Aug 2007 13:44:36 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/20_Back_From_Canada_files/CanadaFlag_1.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/CanadaFlag_2.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:296px; height:162px;&quot;/&gt;&lt;/a&gt;Gillian and I got back from our holiday in Canada a few days ago.  It was awesome!  We started in Toronto, where we saw the Toronto Blue Jays play Seattle Marniners, went to Niagara, Ottawa and Montréal.  We flew from Montréal to Calgary, then drove up to Banff in the Rockies.  Up there we travelled round seeing Lake Louise, Moraine Lake, Johnson Creek, the Athabasca Glacier, the Athabasca Falls &amp;amp; loads more.  We stayed in the posh Jasper Park Lodge, the got the Rocky Mountaineer Train to Vancouver.  We stayed at my Uncle’s place in Delta, saw round Vancouver, North Vancouver, went up Grouse and Cyprus Mountains and went to Vancouver Island &amp;amp; stayed in Victoria.  It was great, I &amp;amp; I can’t belive we were away for 4 weeks, it flew past.&lt;br/&gt;&lt;br/&gt;There are pictures on our Flickr page at: &lt;a href=&quot;http://flickr.com/photos/9871577%2540N07/&quot;&gt;http://flickr.com/photos/9871577@N07/&lt;/a&gt;  Some of the Scenery there is amazing - and really different, in one week we stood on ice, sedimentary mountains, volcanic mountains and desert!&lt;br/&gt;&lt;br/&gt;Well, back to normailty now... :-(</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/20_Back_From_Canada_files/CanadaFlag_1.png" length="7275" type="image/png"/>
    </item>
    <item>
      <title>Off to Canada</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/7/14_Off_to_Canada.html</link>
      <guid isPermaLink="false">55a3e9bd-3f32-4010-9133-2444c00b791f</guid>
      <pubDate>Sat, 14 Jul 2007 14:39:52 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/20_Back_From_Canada_files/CanadaFlag_1.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/CanadaFlag_3.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:296px; height:162px;&quot;/&gt;&lt;/a&gt;Gillian and I are off to Canada on Monday for our holidays.  We’ve been talking about a big holiday in Canada for years &amp;amp; are finally doing it.  We fly out to Toronto on Monday, staying there for a few days, then gradually working our way over to Vancouver.  We fly back from Vancouver in four week’s time.  Should be great, just got to pack now...&lt;br/&gt;&lt;br/&gt;We’ll be putting pictures online as we go.  We’ve got a Flickr page at &lt;a href=&quot;http://www.flickr.com/photos/9871577%2540N07/&quot;&gt;www.flickr.com/photos/9871577@N07/&lt;/a&gt; and a photocast at &lt;a href=&quot;http://photocast.mac.com/gillian.lochrie/iPhoto/canada/index.rss&quot;&gt;http://photocast.mac.com/gillian.lochrie/iPhoto/canada/index.rss&lt;/a&gt;.  You can see the photocast in a browser (it’s just rss), but if you’ve got iPhoto 6, you can subscribe to it &amp;amp; your iPhoto will suck down the photos as we put them into out iPhoto, which is cool in a geeky kinda way.&lt;br/&gt;&lt;br/&gt;PS Don’t try to rob our house while we’re away!  My brother will be staying there looking after the cat!</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/8/20_Back_From_Canada_files/CanadaFlag_1.png" length="7275" type="image/png"/>
    </item>
    <item>
      <title>Bad, TV, Bad.</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/19_Bad,_TV,_Bad..html</link>
      <guid isPermaLink="false">83e1a15f-d6f1-4d87-b9a4-17bed39708d0</guid>
      <pubDate>Thu, 19 Apr 2007 21:37:30 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/19_Bad,_TV,_Bad._files/OTVbelweder-front_1.jpg&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/OTVbelweder-front_1.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:216px; height:180px;&quot;/&gt;&lt;/a&gt;The TV nowadays (geez, I sound like an old man) is full of these 'knock out' talent shows - Fame Academy, Celebrity Ice Dancing, I Want To Be In Joseph In The West End (or whatever it's called) - and I really despise them.  Not just because they are cheap, indistinguishable, and mindless; it is really because I hate the 'Expert Panel Feedback'.  There is always a 'cruel one' on the panel, who criticizes and belittles a contestant's efforts.  Not constructive criticism in in any way, just plain, insensitive cruelty for the supposed 'shock value' the producers seem to think will captivate audiences with &quot;whatever will she say next!&quot; curiosity.  I would have hoped that this was too old now to continue to draw worthwhile viewing figures.  Unfortunately it seems not as (and we now get to what prompted this rant!) I've just turned on the TV and seen Interior Rivalry.  I tuned in just in time to see an American Anne Robinson wannabe heartlessly denigrate a half dozen contestants who had been working on renovating a kitchen.  Ms Wouldbe Robinson then 'voted' out one lady.  This lady was truly despondent and had her moment of personal sorrow intruded upon by a camera mere inches from her tearful face for an unreasonable length of time.&lt;br/&gt;&lt;br/&gt;I just hate that so many TV shows contain this type of cruelty and voyeuristic invasion of people's sorrow.</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/19_Bad,_TV,_Bad._files/OTVbelweder-front_1.jpg" length="36707" type="image/jpeg"/>
    </item>
    <item>
      <title>My Computer History</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/15_My_Computer_History.html</link>
      <guid isPermaLink="false">94ccd86f-2e31-4c93-b4d9-858d2f055778</guid>
      <pubDate>Sun, 15 Apr 2007 15:39:55 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/15_My_Computer_History_files/droppedImage_1.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/droppedImage_3.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:256px; height:162px;&quot;/&gt;&lt;/a&gt;The guys on the &lt;a href=&quot;http://www.macgeekgab.com/&quot;&gt;Mac Geek Gab podcast&lt;/a&gt; are going to be doing a special 100th episode, where they are going to go through their history with computers.  They were asking listeners to send in their own computer histories, so I had a think and put mine together, and thought I would post it here too.&lt;br/&gt;&lt;br/&gt;I got my first computer as a Christmas gift in 1984, when I was 8 years old.  It was a Commodore 64.  At the time in the UK the main players in the home computer market were Commodore, with their 16 and 64, and sincliar, with their Spectrum range.  Acorn and Amstrad were also quite big in the market, with loads of UK schools kitted out with Acorn's Electron and BBC Master computers.&lt;br/&gt;&lt;br/&gt;So I got the Commodore 64.  Loads of my friends had the Sincliar Spectrum, and the Mac vs PC rivalry that we have now was nothing compared to the C64 vs Spectrum rivalry back then.  In fact, even now guys my age who owned these machines will still argue over which was best.  Which is all rather silly, since the Commodore 64 was a way better machine ;-)&lt;br/&gt;&lt;br/&gt;The Commodore 64 shiped with a tape cassette drive, and a modulated video output that hooked up to a TV.  You could get floppy drives and printers for these machines, but only if you were mega rich!  The 64 also had BASIC on board, and the computer's manual had a great introduction to the language, so in between playing games I learned to program on this computer.&lt;br/&gt;&lt;br/&gt;In 1990 I got my next computer a Commodore Amiga 1500, and it was another Christmas present.  The Amiga was a phenomenal machine, with outstanding graphics and sound capabilities, and it had a multitasking graphical operating system called Workbench.  It was leagues ahead of what the mac and pc were doing.  The Amiga 1500 was a UK only model, based on the Amiga 2000.  The only difference between the two was the inclusion of a second floppy drive on the 1500.  The 1500 and 2000 were 'desktop' form factor machines, like the original Amiga 1000 was.  The Amiga 500 was probably the most common model at the time, but this was in an 'all in one' case, similar to the Apple II.  The 1500 was a really expandable machine, and this was the computer that I first installed a hard drive in - a 40mb SCSI drive.  One really cool feature of this computer was that in addition to its own Zorro II expansion slots, were a set of PC expansion slots.  You could buy what was known as a bridge emulator, a hardware PC emulator that bridged both sets of expansion slots, and turned the machine into a PC that you could upgrade with standard PC peripherals.&lt;br/&gt;&lt;br/&gt;The 1500 was also the first machine I got online with.  I got a 2400 baud modem that I used to dial up to BBS's.  I remember thinking that the coolest things in the world were BBSs that had multiple phone lines, because you could talk live to another user in another part of the world.  My first experience of the internet was with this computer and modem in around 1995.  A BBS that I used a lot got hooked up to the internet and users could use it as a gateway.  Irrefutable proof of my geek status is the fact the the very first thing I did on the internet was a search for Star Trek ;-)&lt;br/&gt;&lt;br/&gt;At this time I was in secondary school and the school got kitted out with Macs - Mac pluses, then mac classics, and eventually a color Mac II in the library that had a modem that I used to dial up BBSs and play games on until the school got the phone bill...&lt;br/&gt;&lt;br/&gt;When I went to University, I was writting loads of essays, and I didn't have any decent Word Processsing software on the Amiga, and I was using DTP software just to turn out a presentable page.  This was a drag, so in 1996 I got my next computer - A Compact Presario PC with Windows 95.  This machine had a 1.5gb hard drive and a 56k modem.  I managed to get my essays written with Microsoft Works, and play quake - bit that was about it.  It wasn't a very reliable computer and I thought that the OS was nowhere near as good as the Amiga's.&lt;br/&gt;&lt;br/&gt;At University we were using Mac IIs and PowerMacs in the computing labs.  For my Computing classes we used the macs to log into a unix server.  We would write code in BBEdit on the mac and then compile and run it on the server, which I remember thinking was an odd combination.&lt;br/&gt;&lt;br/&gt;In 2000 I got my first Mac - a G3 iMac.  I was really fed up with the PC, and a friend had just bought a clamshell iBook with OS 8.6.  I remember thinking that this new Mac OS looked way better that the old System 7, and it seemed to be a lot closer the the Amiga philosophy than windows.  So I got the iMac and have never looked back.  It shipped with OS 9, but over the years it got upgraded to 10.0, 10.1, 10.2 and 10.3.  It;s still running, my parents have it and use it daily.&lt;br/&gt;&lt;br/&gt;In 2003 I got a new G4 iMac, and in 2004 I bought a G4 powerbook.  Now at home I also have an intel mac mini, as a media centre in my living room, my girlfriend has an iBook and we have a Shuttle XPC running Suse Linux as a server.&lt;br/&gt;&lt;br/&gt;Also at home I have a Mac Classic that I rescued from the trash at work.  I had a bit of fun upgrading this old machine, and it now has a Mac Classic II motherboard with the 68030 processor, 10mb of ram, a 2 gig internal hard drive, a maths co-processor, an external apple CD rom, and external apple Cartidge CD drive, and a Jazz drive.  And it's hooked up the the net with a Scsi to ethernet adaptor.&lt;br/&gt;&lt;br/&gt;So that’s my computer history.  Oh, I also have a Commodore calculator from 1976, which I think is cool, but not too many other people do ;-) &lt;br/&gt;&lt;br/&gt;C64 Photo by Bill Bertram</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/15_My_Computer_History_files/droppedImage_1.png" length="298711" type="image/png"/>
    </item>
    <item>
      <title>Barenaked Ladies</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/10_Barenaked_Ladies.html</link>
      <guid isPermaLink="false">2c08a35d-325d-44c0-89a0-405a3bc93517</guid>
      <pubDate>Tue, 10 Apr 2007 21:59:59 +0100</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/10_Barenaked_Ladies_files/droppedImage_1.jpg&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/droppedImage_2.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:108px; height:107px;&quot;/&gt;&lt;/a&gt;I went to see the Barenaked Ladies play at Carling Academy in Glasgow on Sunday night.  I went with Gillian and Christine from my work.  Christine had seen them before, but Gillian and I hadn’t.  &lt;br/&gt;&lt;br/&gt;It was fantastic!  Those guys really know how to put on a show.  The thing about it was that the band were having fun - so many bands that you see are always trying to look cool, and have cool sets &amp;amp; cool video, but BNL were just a bunch of guys playing great music &amp;amp; enjoying themselves.  Of course, being BNL, there were a load of gags, including a boy-band-dance-routine-come-bar-brawl and an improvised rap about Stovies.&lt;br/&gt;&lt;br/&gt;The gig was recorded (as all their gigs are) and if you hung about after the gig finished you could buy that night’s recording on a USB flash drive, which is kinda cool.  I’m not sure how they were duplicating so many drive so quickly.  I didn’t wait for one though, cos the queue was huge &amp;amp; it’ll be on the band’s website for download soon (hopefully!)</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/4/10_Barenaked_Ladies_files/droppedImage_1.jpg" length="4132" type="image/jpeg"/>
    </item>
    <item>
      <title>Extending iWeb</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/3/4_Extending_iWeb.html</link>
      <guid isPermaLink="false">5a66f8df-23e9-43e0-9a86-94085939f136</guid>
      <pubDate>Sun, 4 Mar 2007 14:02:09 +0000</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/3/4_Extending_iWeb_files/droppedImage_1.jpg&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/droppedImage_3.jpg&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:216px; height:194px;&quot;/&gt;&lt;/a&gt;I’ve just posted an update to&lt;a href=&quot;../DoIt.html&quot;&gt; Do It (v2.3)&lt;/a&gt;, and I was just going through my little updating/publishing process and thought it would be worth posting the various apps &amp;amp; tools I use for this web site.&lt;br/&gt;&lt;br/&gt;The website is created in Apple’s iWeb.  iWeb is a great app for designing a website - it has some cool templates, its really customizable and designing and laying out is really simple.  The key thing with iWeb is that it doesn’t seem to ‘render’ your pages to html until you go to publish.  This means that when you are creating pages it behaves more like a drawing or DTP application - everything can be moved around freely, layered, edited, etc without the overhead of the application trying to figure out the html/css/js to draw it all in a browser.  Plus it has all the familiar controls from Pages &amp;amp; Keynote, so the UI is really obvious.&lt;br/&gt;&lt;br/&gt;But iWeb does have some drawbacks - certain features (hit counters, comments) are only available if you publish your website to Apple’s .Mac; and there is know way of adding chunks of html for things like Google ads.&lt;br/&gt;&lt;br/&gt;The first extra application I use on my site is iWebMore.  It allows you to embed html into your iWeb site.  You place markers in your pages in iWeb, then when you publish your site to a folder, iWeb more runs through all the files and replaces your markers with the actual html you want in there.  This is how I get Google ads and Amazon buttons on my site.  iWebMore is available at &lt;a href=&quot;http://iwebmore.ctrl-j.eu/iWebMore.html&quot;&gt;http://iwebmore.ctrl-j.eu/iWebMore.html&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;After running iWebMore in my site, I pass it through iComment.  iComment allows you to add comments, talkbacks and counters to your site.  I use it to make my site compatable with &lt;a href=&quot;http://www.statcounter.com/&quot;&gt;http://www.statcounter.com&lt;/a&gt;/ to count hits, etc.  I comment is available from &lt;a href=&quot;http://web.mac.com/cbrantly/iWeb/Software/iComment.html&quot;&gt;http://web.mac.com/cbrantly/iWeb/Software/iComment.html&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;If you create a blog or a podcast with iWeb, it takes care of all the RSS feeds for you.  However, it cannot create a RSS feed for any of your other content.  I’ve started 2 additional feeds on this site - one for application updates and one for new postings to the Do It Skins page.  For these I use an application called Feeder.  Feeder is an excellent application for geneating RSS feed.  It was a wonderful UI that will be familiar and simple for any mac user, it requires no knowledge of RSS or XML, all you do is add information for articles &amp;amp; it generates everything and even uploads it onto your site’s server.  Feeder is available from &lt;a href=&quot;http://reinventedsoftware.com/feeder&quot;&gt;http://reinventedsoftware.com/feeder&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Hopefully we will see some improvements to iWeb when OS X 10.5 finally makes it;s way to our machines, but in the meantime these apps can really help to make the most of an iWeb project.</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/3/4_Extending_iWeb_files/droppedImage_1.jpg" length="30804" type="image/jpeg"/>
    </item>
    <item>
      <title>Cocoa, Applescript, Unicode &amp; Date Formats</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/18_Cocoa,_Applescript,_Unicode_%26_Date_Formats.html</link>
      <guid isPermaLink="false">880e7eeb-e4ec-4b92-affc-05cb5a790ed9</guid>
      <pubDate>Sun, 18 Feb 2007 17:49:57 +0000</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/18_Cocoa,_Applescript,_Unicode_%26_Date_Formats_files/droppedImage_1.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/droppedImage_4.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:167px; height:167px;&quot;/&gt;&lt;/a&gt;I've just fixed a bug in Do It where some users were finding the 'Add deadline reminder in iCal' function wasn't working.  This took me by surprise at first, since it worked OK for me.  Then I realized that the people who had reported in were from Canada, Japan and Italy - so I figured that problem was down to local date and time formats.&lt;br/&gt;&lt;br/&gt;The add to iCal function uses Applescript to pass the info between the two applications.  In Do It (written in Obj-C with Cocoa) the method was:&lt;br/&gt;&lt;br/&gt;-(void)addDealineReminderInICal:(id)toDo&lt;br/&gt;{&lt;br/&gt;	NSDate *deadline=[toDo valueForKey:@&quot;deadline&quot;];&lt;br/&gt;	if(deadline==nil)&lt;br/&gt;		return;&lt;br/&gt;&lt;br/&gt;	NSDictionary *localeInfo=[[NSUserDefaults standardUserDefaults] dictionaryRepresentation];&lt;br/&gt;	NSString *title=[toDo valueForKey:@&quot;thingToDo&quot;];&lt;br/&gt;	NSCalendarDate *start=[deadline dateWithCalendarFormat:nil timeZone:nil];&lt;br/&gt;	NSCalendarDate *end=[start dateByAddingYears:0 months:0 days:0 hours:1 minutes:0 seconds:0];&lt;br/&gt;	NSString *startString=[start descriptionWithCalendarFormat:@&quot;%A, %B %e, %Y %H:%M:%S&quot;] locale:localeInfo];&lt;br/&gt;	NSString *endString=[end descriptionWithCalendarFormat:@&quot;%A, %B %e, %Y %H:%M:%S&quot;] locale:localeInfo];&lt;br/&gt;	NSString *path=[[NSBundle mainBundle] pathForResource:@&quot;AddToICalScript&quot; ofType:@&quot;txt&quot;];&lt;br/&gt;	NSError *readError=nil;&lt;br/&gt;	NSString *scriptTemplate=[NSString stringWithContentsOfFile:path encoding:NSUnicodeStringEncoding error:&amp;amp;readError];&lt;br/&gt;	NSString *scriptSource=[NSString stringWithFormat:scriptTemplate, title, startString, endString];&lt;br/&gt;	NSAppleScript *script=[[NSAppleScript alloc] initWithSource:scriptSource];&lt;br/&gt;	NSDictionary *errorInfo=nil;&lt;br/&gt;	[script executeAndReturnError:&amp;amp;errorInfo];&lt;br/&gt;	[script release];&lt;br/&gt;	if(errorInfo!=nil)&lt;br/&gt;	{&lt;br/&gt;		NSLog(@&quot;Applescript Error: %@&quot;, [errorInfo objectForKey:NSAppleScriptErrorBriefMessage]);&lt;br/&gt;		NSLog(@&quot;Applescript Error: %@&quot;, [errorInfo objectForKey:NSAppleScriptErrorMessage]);&lt;br/&gt;	}&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;The Applescript template that this method loads was:&lt;br/&gt;&lt;br/&gt;tell application &quot;iCal&quot;&lt;br/&gt;	activate&lt;br/&gt;	set the calendar_names to the title of every calendar whose writable is true&lt;br/&gt;	if the calendar_names is {} then error &quot;iCal contains no writable calendars.&quot;&lt;br/&gt;	set the calendar_name to (choose from list calendar_names with prompt &quot;Select the calendar to create the event in&quot;) as string&lt;br/&gt;	if the calendar_name is &quot;false&quot; then error number -128&lt;br/&gt;	set this_calendar to (the first calendar whose title is the calendar_name)&lt;br/&gt;	tell this_calendar&lt;br/&gt;		set this_event to make new event at end of events&lt;br/&gt;	end tell&lt;br/&gt;	set summary of this_event to &quot;%@&quot;&lt;br/&gt;	set start date of this_event to date &quot;%@&quot;&lt;br/&gt;	set end date of this_event to date &quot;%@&quot;&lt;br/&gt;end tell&lt;br/&gt;&lt;br/&gt;With certain date formats selected in System Preference, the Applescript execution would fail with an &quot;Invalid date and time&quot; error.  However, changing the lines:&lt;br/&gt;&lt;br/&gt;	NSString *startString=[start descriptionWithCalendarFormat:@&quot;%A, %B %e, %Y %H:%M:%S&quot;] locale:localeInfo];&lt;br/&gt;	NSString *endString=[end descriptionWithCalendarFormat:@&quot;%A, %B %e, %Y %H:%M:%S&quot;] locale:localeInfo];&lt;br/&gt;&lt;br/&gt;to this:&lt;br/&gt;&lt;br/&gt;	NSString *startString=[start descriptionWithCalendarFormat:[localeInfo objectForKey:NSTimeDateFormatString] locale:localeInfo];&lt;br/&gt;	NSString *endString=[end descriptionWithCalendarFormat:[localeInfo objectForKey:NSTimeDateFormatString] locale:localeInfo];&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;seemed to solve the problem.  I started going through all the format settings in System Preference, &amp;amp; it seemed to be working (including for Canada, Italy and Japan), until I hit Taiwan, and a few other Chinese based formats.  The script execution was failing with the same error as before.  I trip through all the strings in the debugger showed that the values of startString and endString were correct - for example 2007年2月18日星期日 下午06時08分28秒 and 2007年2月18日星期日 下午07時08分28秒 respectively.  I noticed that the Applescript error being returned included the message &quot;Invalid date and time 2007îN2åé18ì˙êØä˙ì˙ â∫åﬂ06éû08ï™28ïb&quot;, so it seemed like there was a problem reading the unicode characters in the startString/endString values.  Looking at the value of the scriptSource string however, it included all the unicode characters, correctly formatted.&lt;br/&gt;&lt;br/&gt;A bit of Googling revealed that unicode characters can be entered and and compiled OK in the Script Editor application, but that Applescript will parse them as Mac-Roman or UTF-8 unless explicitly told otherwise.  Applescript includes a type 'Unicode text', and strings can be parsed as unicode by casting them to this type with the command &quot;... as Unicode text'.  Changing the lines to the add to iCal script template to the following:&lt;br/&gt;&lt;br/&gt;	set summary of this_event to (&quot;%@&quot; as Unicode text)&lt;br/&gt;	set start date of this_event to date (&quot;%@&quot; as Unicode text)&lt;br/&gt;	set end date of this_event to date (&quot;%@&quot; as Unicode text)&lt;br/&gt;&lt;br/&gt;forced applescript to read the unicode date strings correctly, and now the script seems to execute correctly in all the locales.</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/18_Cocoa,_Applescript,_Unicode_%26_Date_Formats_files/droppedImage_1.png" length="29183" type="image/png"/>
    </item>
    <item>
      <title>Poor Chloe</title>
      <link>http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/7_Poor_Chloe.html</link>
      <guid isPermaLink="false">2c12c875-d232-49c8-bf0d-f64fb2d487b9</guid>
      <pubDate>Wed, 7 Feb 2007 22:08:34 +0000</pubDate>
      <description>&lt;a href=&quot;http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/7_Poor_Chloe_files/droppedImage.png&quot;&gt;&lt;img src=&quot;http://www.jimmcgowan.net/Site/Blog/Media/droppedImage_5.png&quot; style=&quot;float:left; padding-right:10px; padding-bottom:10px; width:216px; height:139px;&quot;/&gt;&lt;/a&gt;My little kitten, Chloe, was at the vet yesterday to get dressed.  I dropped her off at the vet in the morning on my way to work, and Gillian went back to collect her in the afternoon.  Chloe now has a big bald patch in her side, where they shaved her, with a stitched up incision in the middle of it.  She manages to look pitiful and comical at the same time.&lt;br/&gt;&lt;br/&gt;She was really out of it last night, I think the whole thing knocked her for six.  She was really quiet (which is unheard of!), sleepy and a bit wobbly on her feet.  She was a poor wee soul last night.&lt;br/&gt;&lt;br/&gt;But, today I think she has recovered.  Tonight she has climbed onto the roof of our neighbour’s shed twice, shredded a newspaper and distributed the pieces throughout the house.  Definitely feeling better!</description>
      <enclosure url="http://www.jimmcgowan.net/Site/Blog/Entries/2007/2/7_Poor_Chloe_files/droppedImage.png" length="918750" type="image/png"/>
    </item>
  </channel>
</rss>
