Showing posts with label Macintosh. Show all posts
Showing posts with label Macintosh. Show all posts

Thursday, June 27, 2013

Fixing Mail.app's Unread Message Count

After a few days of looking at the Dock badge on Mail.app reporting 172 unread messages (untrue), I searched for a solution. I found this one, Unread message count is wrong in Mail and Dock, with a suggested process.


  • Quit Mail if it’s open.
  • In ~/Library/Mail/V2/MailData, delete any file that begins with “Envelope Index,” such as Envelope Index or Envelope Index-shm.
  • Your home Library folder is hidden by default. To display it, choose Finder > “Go to Folder” and then enter “~/Library.”
  • Open Mail.
  • Mail creates new Envelope Index files. This process may take a few minutes, depending on how many messages Mail is reindexing.
I gave it a whirl ... my laptop fan spun all the way up, noisy, long wait ... and it mostly worked! Mostly means that the Mail.app badge in the Dock showed the correct number of unread messages, but I was no longer seeing any messages in any of my Exchange (ewww) mailboxes. Oops! I deleted and re-created the account to get everything working again.
I think my Mac is jealous of my Xubuntu laptop, so it's trying to tie up more of my time. I think that's gonna backfire ...

Friday, January 4, 2013

Clipboard to Google Calendar

I enjoy a good shell script, so here's what I cobbled together. This script requires Mac OS X (every version so far has pbpaste) with the Google CLI (gdata-python-client, I used version 2.0.17) installed. The basic command is google calendar add --cal Calendar "Event 1/4/2013 at 3:00 PM in Location" but I used a script for error checking, and I only have to scroll back to the last error to see all of the problematic entries.

#! /bin/bash

## This script sends the clipboard to Google Calendar one line at a time.
## REQUIRES: Google cli from http://code.google.com/p/gdata-python-client/
##
## Version 1.0  2013-01-04  nethope
##
## 1.0  2013-01-04  initial
VERSION="1.0"
NAME=${0##*/}

###
## Variables
#
# 0 for no DEBUG
typeset -i DEBUG=1
if (( $DEBUG )); then /bin/echo Debugging on...; fi

###
## Parameters
#

## Paths
ECHO=/bin/echo
GOOGLE=/usr/local/bin/google
PBPASTE=/usr/bin/pbpaste

###
## main()
#
if (( $DEBUG )); then $ECHO Script ${NAME} running; fi

FAILURES="" NEWLINE=\\n
typeset -i TALLY=0
$PBPASTE | while read -r LINE
do
  $GOOGLE calendar add --cal Calendar "${LINE}"
  EXIT_STATE=$?
  if (( $EXIT_STATE )); then
    TALLY+=1
    FAILURES+=${LINE}${NEWLINE}
    echo -e "${NEWLINE}!!! Failed on line"
    echo -e "      ${LINE}${NEWLINE}"
    if (( $DEBUG )); then
      echo -e "  Errors add up to ${TALLY}"
      echo -e "  Failed lines are"
      echo -e "${FAILURES}${NEWLINE}"
    fi
  fi
done

# use exit code values of 0 (success) and 64 through 113 (or 125)
exit 0

Wunderlist

So I have been experiencing the Wunderlist "Synchronizing failed" error, and finally decided it wasn't going away on its own so I should do something about it. Since I'm still using WL1, I wanted NOT to logout. Luckily, I can extract my data, using Wunderlist-Helpers, or even simpler using the command line.

Mac OS X has come with sqlite3 for a while now, so no installation needed.

$ find ~ -name "wunderlist.db" -print 2>/dev/null
~/Library/Application Support/Titanium/appdata/com.wunderkinder.wunderlist/wunderlist.db
(be sure to escape the space with a backslash!!!)
$ cd ~/Library/Application\ Support/Titanium/appdata/com.wunderkinder.wunderlist/
$ sqlite3 -csv -header wunderlist.db "select * from tasks left join lists on tasks.list_id=lists.id;" > ~/Desktop/wunderlist_export.csv
$ open ~/Desktop
$ open ~/Desktop/wunderlist_export.csv
Now you should see your desktop folder with the newly created export file, and it should be open in your default CSV viewer!

I think I'm going to go from Wunderlist back to Google Tasks.

Saturday, September 8, 2012

Easy Fix

Well, I think that was one of the easiest fixes ever! I had an external monitor hooked up to my home laptop for extra pixels. I used the mini DisplayPort to VGA adapter that came with my laptop. The monitor developed interesting colors and patterns, so I quit using. When my 4-year-old asked for his own computer (ORLY?), I borrowed a Mac mini from a co-worker, and decided to try the failing monitor. However, the Mac mini only had DVI so I dug up a DVI cable ... and the monitor has been working perfectly ever since! Something in my VGA chain (the adapter, the cable, or the monitor's VGA connection) had gone bad, but it didn't affect the display on the DVI chain.

I love it when monitors are that easy to fix!

Thursday, August 16, 2012

VNC Server on Mac OS X 10.3

I didn't want to get more hardware right now, so I wanted to use the keyboard and mouse that was on my older PPC Mac, still running OS X 10.3. It doesn't do Remote Desktop's Screen Sharing as easily as newer OS X, so I wanted to use Vine VNC for a VNC server. I downloaded version 3.12, but the disk image wouldn't mount under 10.3. So, back to my newer Mac, mount, copy the application off, and (not wanting to hit further problems, although I did not test if this were still necessary) I also deleted Tiger.bundle before copying it to the older Mac. VoilĂ ! it works!

Friday, November 4, 2011

web100clt for Mac

# install the latest Developer Tools
cd /Developer
mkdir Source
cd Source/
curl -O http://software.internet2.edu/sources/ndt/ndt-3.6.4.tar.gz
cd ndt-3.6.4.tar.gz
cd ndt-3.6.4
tar -zxf ndt-3.6.4.tar.gz
cd ndt-3.6.4
./configure 2>&1 | tee configure.out
make 2>&1 | tee make.out
find . -name web100clt
file src/web100clt
sudo cp src/web100clt /usr/local/bin

Tuesday, September 13, 2011

Lion Annoyances

I'm not ready to install Lion on all of my Macs, but it came on my new MacBook Pro at work. Yesterday, Time Machine was a fantastic way to get my applications, files, and preferences from the old laptop to the new! Now comes the more tedious task of making friends with Lion.

First up, the scroll wheel on my mouse scrolled in the wrong direction! I don't want to change everything else (older Mac OS X and Linux) to match, so I had to change Lion's default behavior. Apple menu > System Preferences > Mouse, un-check "Move content in the direction of finger movement when scrolling or navigating." Whew!

After that, I'm making friends with Apple's Lion.

Friday, September 2, 2011

Keyboard Shortcuts for Mail.app

Every previous time I've tried to use Mail.app before, I've gone running back to Thunderbird usually within a day. This time, thanks to a large monitor (so I leave Mail.app in the 3-pane single window more so that keyboard navigation works) and this tip on adding Gmail-like shortcuts to Mail.app using Quicksilver, and this tip to color a Mail message, I don't miss Thunderbird, I have better Exchange integration (ugh), I'm not reaching for the mouse too often, and I can now view graphic attachments like PDFs inline.

Quicksilver is awesome! AppleScript gets the job done, and consequently now Mail.app gets the job done too.

Tuesday, August 16, 2011

Chicken

On my Mac, I upgraded from Chicken of the VNC to Chicken (and you should too) because it works with IPv6 connections. It's also a very easy VNC client.

Tuesday, August 9, 2011

Color Your Mail

By using the number keys (zero to five) in Thunderbird (my preferred mailreader) I can easily assign different colors to the mails in the inbox. I’ve made a little system of my own where one color means urgent, another “less important todos” and so on.

My mailbox is IMAP-based and through the magic of IMAP, the color codes even carries themselves between the different machines I use (and works within Apple’s Mail.app too).

It may not revolutionize your life, but it sure helps me just a little bit – each and every day

from Color code your mail « Netfactory

I used to use the IMAP tags to color-code my email in Thunderbird heavily, until we switched from good ol' IMAP to Exchange 2010. Even though this Exchange server has IMAP enabled (thank goodness!), Microsoft doesn't support IMAP tags, so my color-coded tags no longer show up in all of my Thunderbird clients.

That takes some of the shine off of Thunderbird. Add in its memory usage, and I'm trying Apple's Mail.app yet again. I'm now accustomed to messages being colored per-client, but I still wanted to color my messages without creating complicated Rules in Mail.app. Luckily, I found an old post:

If you want to color code your messages in the Mail app just press Apple-Shift-C to bring up the color palette. Select any color and you’re done.

Awesome! I may be able to take the leap this time!

Saturday, January 16, 2010

iMovie '09 on a PowerBook G4

I started with this Google result to install iMovie '09 on a PowerBook G4, but I had a few problems as written and came up with a similar way that worked for me. I copied iMovie.pkg to my hard drive, then "Show Package Contents" to get to Distribution.dist that I edited with TextEdit. Near the top, under Installer logic, I made this function replacement:

function installationCheck()

{

return true;

}

The original function is longer, but it keeps me from installing iMovie directly, which is all I wanted to do. Then I went back to the original hint and ran defaults write NSGlobalDomain allowG4Launch -bool YES to finish the job. An awful lot of bounces in the Dock (old, old laptop), but it launches!

Tuesday, January 5, 2010

The Mini Re-Test Against (Quicken and) Buddi

It's been two years, and it feels like time to look at alternatives to Quicken for personal finance. I've been using Buddi happily for 2 years. It's updated regularly. It's portable (cross-platform and no funny stuff in the data files). Java isn't as slow as I expected, and Buddi even accepts dropped text. It has a stable of plugins. However, some of export plugins don't work as well as I'd like. The unmaintained QIF Export has no option to export each account separately which is needed for most of the personal financial software I've tested, and, much worse, the starting balance in the QIF file was off by about two orders of magnitude! Since only the starting balances were wrong, I edited those lines by hand in TextEdit, but it makes me not trust the QIF Export plugin -- not fun for all of your financial data. [I suspect the safer route is to use CSV export and then use a CSV-to-QIF tool written in awk, perl, python, or ruby; the other direction is Javascript that you can even download to your own computer.] And Buddi isn't Aqua, or integrated with anything else on my Mac. Buddi is a very reliable program that I could use for many more years, but I don't mind looking at the alternatives either.

So, to review from last time, my needs are:

  • reconcile that I can use
  • proper double entry for transfers
  • import/export
  • would like multiple accounts in one document
  • would like bill scheduling, although I have reminders in iCal now

A quick check for what was updated since 2008 and had tempting screenshot(s) led me to Stash (new yummy open-source Aqua!), mini$, and MoneyWell. Although I looked at those last two before, they had major version updates so I thought I'd look again.

The quick one: mini$ had a big update since I last tested it, but it wouldn't launch on my Intel MacBook Pro, so that test is done already. The error was "java.lang.UnsupportedClassVersionError: Bad version number in .class file" so I think my Java is too new for it (it needs 1.4.2+ and I have the standard 32-bit 1.5.0_22 version in). I need the newer Java for work applications, so I don't want to mess around with older versions of Java.

So here's the report on Stash and MoneyWell.

Stash is very new, so I'm reviewing a moving target. Reconcile is just a check, but I can use that (no check for cleared, though). I like that Stash can re-order transactions so that I can match Stash's balance with my bank statement (which is the order in which the transaction cleared, not when it occurred); this makes reconciliation easier. As of version 0.6, it has double entry transfers, although if I delete one half of a transfer, the other half is still there (although that shouldn't be common). Stash can import and export QIF, and it has multiple accounts per document, with transaction scheduling. It hits my necessary points, and it has bonus points for Aqua and a responsive developer. It's worth a look. Plus there's just something pretty about it that makes me want to like it!

MoneyWell does a lot. It has states for open, pending, cleared, and reconciled transactions (although I can't click on the icon to cycle between open, cleared, and reconciled). It transfers. It imports many formats including CSV, QIF, and OFX, although it only exports to QIF. It has multiple accounts in one document, and it does bill scheduling although it filled in the current variable amount for the future transactions as well. (Quicken asked me if the amount were the same or if it varied.)

I think I should use the MoneyWell Bucket construct for what are Categories in Quicken and Stash, and Budget Categories in Buddi. Watch your left-hand pane when using MoneyWell: your view is filtered to whatever Accounts and Buckets you have selected! So if you think you're missing an entry, select ALL Accounts and the "All Transactions" smart bucket! Although I don't plan to use this feature, MoneyWell can link an account in your MoneyWell document to an online account in order to download transactions. There even appears to be a way to manage similar and duplicate transactions (I'm sure that's useful)!

I really can't explain why I'm not sucked in by MoneyWell with all of its features, but yet I find Stash attractive despite a shorter feature list. I guess it's because MoneyWell doesn't have the user interface convenience I expect when I click on the open-cleared-reconciled checkbox. I want utter simplicity, and MoneyWell has a flurry of ways to filter my view. Stash, on the other hand, is very much like a checkbook register. It's simple, and it does what I expect when I click on the reconciled check. I don't need the very simple budgeting in MoneyWell, and the graphs in Stash supply eye candy if I want it. Stash has a simple, uncluttered, unconfusing user interface.

Monday, December 28, 2009

Tagger

The best utility software is so transparent in use that you don't even notice you're using it. I'm a fan of OpenMeta tags, so I started using Tagger:

Tagger is a small application for OS X that can be used for quickly adding arbitrary textual [OpenMeta] tags to files.

I only noticed it this morning when I clicked on the "Update available!" button. One of the updates is to use Sparkle for future updates, so I won't even have these minor reminders that I'm using it anymore! So now's the time for a shout-out while I remember. This is such an easy way to tag files ... Between Tagger and OMSavePanel (no, I haven't installed Snow Leopard yet, so I'm not using Save Panel Extender), most of my newly created files are now tagged.

Friday, November 20, 2009

Patience ...

Not that I'm exactly the patient type (having been a happy user of uControl for a long time until OS X offered this keymap), but sometimes good features will come if you wait. Initially I wanted to have CAPS LOCK and CONTROL in the same place on all of my keyboards, and my laptops needed to switch them. (I have muscle memory for many Unix control-key options, and hitting CAPS LOCKS instead can lead to foul language.) Then I put my work MacBook Pro, originally with OS X 10.4, on a KVM with an IBM keyboard, and I needed to switch COMMAND and OPTION. However, this led to another annoyance: if I swapped COMMAND and OPTION for the external keyboard, they were swapped when I took the laptop sans external keyboard to a meeting.

I've been running 10.5 for ages, but I finally paid attention while I was tinkering with the keymap: it now supports per-recognized-keyboard remaps! I know the novelty will wear off soon and I'll forget how much I love this feature unless someone asks me directly, but it's a very welcome feature addition to the welcome feature of keymapping. Sometimes it is the little things that makes long meetings with minimal content not so annoying.

Monday, October 12, 2009

Finder Toolbar Links

The Drag a link to Tagger into the Finder toolbar screenshot was driving me nuts because it's not that simple. I dragged, and the link just bounced back to the application. So I tried some keyboard combinations (since the screenshot indicates that it's possible), and sure enough, COMMAND-OPTION is the magic pre-drop key combination! Of course, now I'm used to it in my Finder sidebar, so I don't need it in my toolbar, but it's nice to know I can do that when I want.

Thursday, October 1, 2009

Sad Information Move

Well, I really want my notes to be accessible, and that means available to Spotlight more and more now, so with some sadness and some help from touch -r, I just migrated the first document from Alepin to Journler.

Alepin's export preserves the hierarchy (the way I wish the document package's internal structure did, #3 on my wishlist), but it doesn't preserve timestamps. So the package structure is flat but with the timestamps I want, and the export structure is hierarchical with a 'now' timestamp. I believe I can fix this!

cd ~/Desktop/Notes\ Exported

find . -name "*.rtf" | grep -v TXT.rtf | tee adjustTimes.txt

find . -name "*.rtfd" | tee -a adjustTimes.txt

ORIG=~/Documents/stuff/Notes.alpn

while read FILENAME; do echo "${FILENAME}"; ls -l "${FILENAME}"; BASENAME=${FILENAME##*/}; ls -ld "${ORIG}"/"${BASENAME}"*; echo; done < adjustTimes.txt

while read FILENAME; do echo "${FILENAME}"; ls -l "${FILENAME}"; BASENAME=${FILENAME##*/}; ls -ld "${ORIG}"/"${BASENAME}"*; touch -r "${ORIG}"/"${BASENAME}"* "${FILENAME}"; ls -l "${FILENAME}"; echo; done < adjustTimes.txt

rm adjustTimes.txt

Let's decompose that last long while loop. (And take out the touch command the first time you try this yourself!!! Make sure the right files show up, to make sure you won't mind the results!)

while read FILENAME; do (stuff); done < adjustTimes.txt

This is a while loop that puts the entire line, one line at a time from that text file, into the variable FILENAME. This is the iterative engine!

First, display the filename (make sure spaces come through properly escaped) with echo "${FILENAME}". Then show the directory listing with timestamp via ls -l "${FILENAME}": too new.

Since Alepin's package structure is flat, strip off everything in front the last slash; ## is greedy match removal, */ is anything before and including a slash. This should be the rtfd filename inside the Alepin document. However, rich-text-only exports from Alepin are sensibly just RTF. So to look at that timestamp, I need to convert *.rtf to *.rtfd ... or just tack on * to match zero or more characters for ls -ld ~/Documents/stuff/Notes.alpn/"${BASENAME}"*.

If all that checks out when you test it, it's time to move the Alepin timestamps to the Alepin export with touch -r ~/Documents/stuff/Notes.alpn/"${BASENAME}"* "${FILENAME}"! Admire the results with a final directory listing with updated timestamps: ls -l "${FILENAME}" (and a final echo for visual space).Ta-da!

rsync script

I wrote a quick bash script about a month ago to do my daily rsync, but I had a problem that took the quick and easy fun out of the script for several days. What worked on the command line to handle spaces didn't work in the script! The answer was buried in the rsync FAQ:

The [rsync] command line is interpreted by the remote shell and thus the spaces need to arrive on the remote system escaped so that the shell doesn't split such filenames into multiple arguments.

That's the core of the problem, but backslashes didn't seem to help. I went for the ? solution, to match one character that happens to be a space, instead.

Today I discovered that I probably could have stayed with what worked on the command line (but not in the script) if I had used eval on the scripted rsync command.

Tuesday, September 29, 2009

The Perfect Alepin

I think everyone has their own version of the perfect application to store all of those information tidbits. The time before last when I went looking for mine, I picked Alepin. Since it has been sold and hasn't been updated, I had to pick another (Journler), but I still miss the good parts of Alepin. It's easy to dream while your product is in update limbo, so here's my sorted list of enhancements to make Alepin perfect.

  1. Spotlight support. This is a deal-breaker for me. Without Spotlight, I have to launch an application to find my memory. With Spotlight, I just search from the menubar and find any tidbit in any application (with a Spotlight importer).
    • QuickLook makes filtering Spotlight results just that much easier.
  2. I want per-page tags, preferably OpenMeta tags. I suppose the new developers would have to worry about which file systems don't support extended attributes (like Dropbox, SMB mounts ...) so I guess Alepin needs a hidden file for that, making it less clean. Or a warning "Tagging only supported on ..." but that doesn't catch a Finder copy that causes data loss. So they need duplicate tagging, OpenMeta where supported and a per-document-bundle hidden plist. And a method to sync those as needed.
  3. I always wished for the internal structure to match hierarchy, meaning "Show Package Contents" in the Finder would have the same nested folders as Alepin's display, because then I could duplicate page names (Hotels in both the Asheville and Wilmington folders in Travel.alpn), and because then the "recoverability" if an Alepin doc gets corrupt is essentially perfect. All cases were my own fault and easily recovered, but I have had my Alepin documents get corrupted.
    • This could go interesting places, in that Alepin becomes a browser to a folder of RTFD, especially if metadata like tags goes on the file and the safety file can be re-created from the component documents.
    • Add in textutil's ability to convert to rtfd ... this could go many places. I haven't thought this all the way through, especially since it's not how I would use Alepin. I'm happy with its Import and Export (to nested folders that aren't in its internal hierarchy!).
  4. Fix bug where editing a internal component rtfd (using "Show Package Contents" or found because of my tweakings for Spotlight) with TextEdit would cause the whole document.alpn to be corrupt on next launch. Since it showed up in a search, a proper Spotlight importer would help here too; but Alepin would need to be able to open an Alepin document in context to fix it well.
  5. Fix bug where password-protecting an Alepin document on one Mac, copying (well, bbouncer-approved rsync-ing) that document to another Mac and trying to open it would show the corrupt message. Yeah, apparently I can corrupt documents like nobody's business.

I love(d) Alepin, but I need to be able to find and use what I've stored, in a format with easy recoverability from corruption, with solid import and export choices, preferably document-based. I tried (and bought) Circus Ponies, but since then I bought and am using Journler instead because it just feels easier.

Thursday, August 13, 2009

The Syncplicity Saga

When my USB thumb drive died, and then its brand new replacement followed it, I looked for an online alternative. I picked Syncplicity because I liked the screen shots: I knew exactly what I would see as a user. I used it to access live copies of my most-used files on both my work and home MacBook Pros. Well, Syncplicity decided to drop Mac support cold at the end of last month. I finally got around to uninstalling it, which was a pain because the directions disappeared out from under me.

If you need 'em, those directions are:

1. Shut Syncplicity down

2. Delete /Applications/Syncplicity.app

3. Delete /Library/Contextual Menu Items/SyncpCMPlugin.plugin

4. Delete ~/Library/Application Support/Syncplicity

5. Restart your Mac

My first thought while reading those directions was:

1. osascript -e "tell application \"Syncplicity\" to quit"

2. rm -rf /Applications/Syncplicity.app

3. sudo rm -rf /Library/Contextual\ Menu\ Items/SyncpCMPlugin.plugin

4. rm -rf ~/Library/Application\ Support/Syncplicity

5. osascript -e "tell application \"Finder\" to restart"

so I decided to script it. Since the first and last steps were AppleScript commands, I dabbled around and came up with an AppleScript application to uninstall Syncplicity for the Mac (download).

For alternatives, I picked Dropbox (SugarSync is similar), but if you lean towards backups too then Mozy, iDrive, and rsync.net are also strong contenders.

The last step, after making sure all my files are current and local, is to cancel my account at Syncplicity. Time to move on!

Tuesday, August 11, 2009

Useful tip

From the inimitable Daring Fireball, how to see if an application is running with AppleScript:

tell application "System Events"

count (every process whose name is "BBEdit")

end tell

I modified that into tell application "System Events" to set syncpRunning to count (every process whose name is "Syncplicity") for my purposes.