Pick of the Week - May 5 [Show all picks]
Pixelmator - Image editor with Core Image support
Submit HintSearchThe ForumsLinksStatsPollsFAQHeadlinesRSS 10,000+ hints and counting!
Welcome to macosxhints.com
Search:   Advanced  
  10.5: Convert text to iTunes audio book via Services item
Apps
After reading this hint on macosxhints about how to create an audio file from text, I figured the process could probably be streamlined a bit. So, I created a Service (that appears in the Services menu) that operates on selected text. Select the plain text in your source location (text file, web page, email, etc.) and then select Services » Speak to iTunes Audiobook to speak the text into a track that will appear in the Audiobooks section of iTunes. Just remember to set the encoder quality beforehand in iTunes, because it's not configurable through AppleScript (I recommend using 'Spoken podcast').

Package download [40KB]

For those curious few, the AppleScript within the service is as follows:
on process(input)
  set theOriginalPath to (path to desktop folder as string) & "Speech.aiff"
  
  -- Speak text
  say input using "Alex" saving to theOriginalPath
  tell application "iTunes"
    -- Import AIFF audio
    set theOriginaliTunesFile to (add theOriginalPath)
    tell application "Finder" to delete theOriginalPath
    -- Prepare AAC encoder
    set lastEncoder to current encoder
    set newEncoder to (item 1 of (every encoder whose format is "AAC"))
    set current encoder to newEncoder
    -- Convert to AAC
    set theM4aFile to item 1 of (convert theOriginaliTunesFile)
    set current encoder to lastEncoder
    -- Remove original
    delete theOriginaliTunesFile
    set fileLocation to location of theM4aFile
    -- Set as audio book type
    tell application "Finder"
      set theFile to fileLocation as alias
      set file type of theFile to "M4B "
      if name extension of theFile is not "m4b" then
        set name of theFile to ((text 1 thru -((length of (get name extension of theFile)) + 1) of (name of theFile as text)) & "m4b") as string
      end if
    end tell
    -- Remove from iTunes, and re-add
    delete theM4aFile
    set theNewTrack to add theFile
    -- Select in iTunes
    reveal theNewTrack
  end tell
end process
[robg adds: I tested this, and it works as described. The service is installed in the top-level /Library » Services menu, and can be removed by simply deleting SpeakToItunesAudiobook.service in that folder. Once installed, you need to refresh the Services menu to see the new service; you can do that by logging out and in, by using one of the methods described in this older hint and its comments, or by using a third-party program such as ServiceScrubber. Note that this is set to 10.5 Only due to the use of the Alex voice; I'm not sure if it would run on 10.4 with a different voice, or if there are other AppleScript commands in the script that are 10.5 only as well.]
  Post a comment  •  Comments (5)   [2,139 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Work in some windows while Dashboard is active
System
I use a small utility called Witch to switch between open windows in applications via Option-Tab, instead of using the built-in Command-Tab, which just switches between applications. I recently realized that, when Dashboard is active (F12), you can use Witch (Option-Tab) to select a window, and then you can do some things in this window while still having Dashboard active and frontmost.

For example, you can select a TextEdit window and write in it, jotting down some notes relative to something in a Dashboard widget. This will work as long as you don't click the mouse button. I've found this quite useful at times.

[robg adds: This could also be useful for selecting text in a background window and copying it (hold down Shift and use the arrow keys to select text, then press Command-C), for pasting into a Dashboard widget, if you forgot to copy it before you invoked Dashboard.]
  Post a comment  •  Comments (6)   [938 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Improve stability of some USB-based wireless adapters
Network
I'm using a D-Link DWL-G122 in versions C1 (and own a version B1, a D-Link DWL-122, a Linksys@Home 54g USB, and a Belkin F5D6050 USB -- insert sarcasm here), and have worked with (too) many similar Ralink or Prism-based USB wi-fi adapters on OS X over the last four years or so. One issue I experienced (with all of these adapters) was when the adapter was either under heavy load, or (especially) when using Internet Sharing in OS X, the adapter would randomly disconnect from its wireless network and lose all communication with the driver/config software. To fix things, it would require an unplug/replug to resume operation. With many people reporting this on the net, and having tried every suggestion I could find, I have finally found the answer that has since worked solid for over three weeks (and over 150gb of transfer) now without a single disconnection with any of my adapters!

Just for good measure, I tried (and failed) with these solutions:
  1. A wide selection of Mac OS versions/subversions, Mac hardware, USB ports, etc.
  2. All variations of network encryption options.
  3. Running every version of driver software (D-Link as well as Ralink) I could find.
  4. Many different USB extension cables, as well as without extension cables.
  5. Powered hubs - No luck, although this did make things notedly quicker and is highly recommended especially if you are using a G4 PowerBook as their USB power is pathetically unstable.
Beyond that, I tried probably everything else you can think of, but still, the problem persisted.
  read more (676 words)   Post a comment  •  Comments (5)   [1,263 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Some ways to avoid some Word 2008 crashes
Apps
As part of my job, I edit large Word documents, usually created by Windows users. These documents include pictures, comments, tracked changes, and so on. Word 2008 seems to hate them -- it crashes more than a drunken toddler driving a Ferrari. Over time, however, I've developed a number of techniques to mitigate the disasters.

If Word crashes and then restarts, don't accept its recovered document. Close it and then open the last version you saved. Also I only ever use Save As now, not File » Save, or Command-S. I think it's this form of saving that's causing the problems. Maybe the disastrous bug is part of a 'quick save' routine?

Finally, if there's a document that Word crashes with, and continues to crash with, I had some luck opening it on a Windows version of Word using VMWare Fusion, and then saving it out again. This seems to iron out the bugs, but it didn't always work (and in fact, worked fewer times than it actually worked in the first place).

[robg adds: I haven't experienced many crashes with Word 2008, but my document needs for it are quite light by comparison, so perhaps it has something to do with the size and complexity of the document in question.]
  Post a comment  •  Comments (12)   [1,037 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Use a Smart Folder to remove certain iChat log files
Desktop
With family, friends, and coworkers scattered around the country and the world, iChat is one of my most-used applications. Given that a lot of important conversations flow through it, I've archived my iChat logs for years using the "Automatically save chat transcripts" feature in iChat. One annoyance, though, comes courtesy of the VPN we use to reach the Macworld servers. Every time I connect and disconnect from the VPN (many times a day), AOL generates a warning that shows up as a new iChat message:
Your screen name is now signed into AOL(R) Instant Messenger (TM) in 2 locations. To sign off the other location(s), reply to this message with the number 1. Click here for more information.
Of course, each and every one of these messages is logged, though I clearly don't need to save them. To make it simpler to get rid of these extraneous logged files, I created a Smart Folder with the following search criteria, with "Any of the following are true" at the top level:
  • Name -- begins with -- aolsystemmsg
  • Name -- begins with -- AOL System Msg
For whatever reason (related to being on or not on the VPN, perhaps?), there are two different names for the sender of the message from AOL, so I search for both names. Once I set up the search, I dropped it in the Search For section of my sidebar. Deleting these saved chats now only takes a couple of mouse clicks and keystrokes. There are other more automated ways to do this -- some sort of find command run as a launchd task or cron job comes to mind, but this method was simple and fast.
  Post a comment  •  Comments (1)   [990 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Use Script Editor to develop bookmarklets
Web Browsers
If you're developing a non-trivial bookmarklet you may be able to speed up your edit cycle by having an applescript which executes the javascript in your browser, like this:
tell application "Safari"
  activate
  do JavaScript "
    // Of course your bookmarklet code goes here, for example...
    alert('hello world');
  " in front document
end tell
I just edited the Javascript in Script Editor and hit the run button to test. Just be careful of using double quotes, and you can postpone escaping the script and adding it to your bookmarks until the very end.
  Post a comment  •  Comments (1)   [815 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Access Sprint Family Locator site with Safari
Web Browsers
If you are like me and love using Safari as the default browser and also subscribe to Sprint's Family Locator service, you may have to switch to Firefox in order to access their website.

Not the case anymore. You must first enable the Develop menu in Safari, which you can now do in the Advanced section of Safari's Preferences panel. (Older versions must use the solution in this hint). Then click on the Develop menu in Safari, choose User Agent, and select the latest version of Firefox for Mac from the list before you log into the Sprint Family Locator website.

You will now be able to login and browse Sprint Family Locator website with Safari. So far, I have not noticed any features that don't work when using this workaround.
  Post a comment  •  Comments (3)   [932 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Jump through files alphabetically regardless of sort order
Desktop
This sounds too simple for a hint, but I haven't heard of it before, and couldn't find a reference for it on the web (and I discovered this completely by accident). By Pressing Option-Tab in the Finder (in List or Icon view windows), you can jump alphabetically through the files, regardless of the displayed sort order.

[robg adds: This also works in Cover Flow view in 10.5, though it's pretty strange watching the icons do a seemingly-random dance as you press Option-Tab.]
  Post a comment  •  Comments (8)   [1,507 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Display week numbers on 'cal' calendars through 'ncal'
UNIX
According to man cal, there's also an ncal command with extra options, such as displaying week numbers via the -w flag. But no ncal is installed in OS X. A little experiment reveals, however, that it's one and the same program -- it apparently behaves differently when named differently.

If you create an ncal link to the cal utility, you get a fully functional ncal program; note the week numbers below the calendar:
$ mkdir -p $HOME/bin
$ ln `which cal` $HOME/bin/ncal
$ $HOME/bin/ncal -w
    May 2008
Mo     5 12 19 26
Tu     6 13 20 27
We     7 14 21 28
Th  1  8 15 22 29
Fr  2  9 16 23 30
Sa  3 10 17 24 31
Su  4 11 18 25
   18 19 20 21 22
[robg adds: This works as described; you can also now use ncal -e or ncal -o to see the date for Easter (Western and Orthodox, respectively), -J for the Julian calendar, and -p to see the "country codes and switching days from Julian to Gregorian calendar as they are assumed by ncal." I tried creating an alias instead of a link, but that didn't work...can anyone explain why they chose to make cal and ncal work like this? Why not just give all the options to cal?]
  Post a comment  •  Comments (8)   [1,529 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
  Another Mail.app Exchange invite to iCal time zone fix
Apps
As any Mac user who deals with Microsoft Exchange invites will tell you, Exchange screws up the time zone information. What this means is that you will likely miss your meetings. Not a good thing. I've adapted an AppleScript from an older hint to correct this problem. This script can either run from the System-wide Script menu from within Mail.app, or as a Mail.app rule.

Here's my modified script. Save the script and either set it up to run from a Mail rule, or as I do, call it from the system-wide AppleScript menu. You will need to save the script in ~/Library » Scripts » Applications » Mail/ folder; create this folder if it doesn't exist. This solution has the advantage of being a single script with a simple user modification for customization.

There is one property at the head of the script that needs to be modified. It is the iCal-approved location of your Exchange server. What you need to do is copy in the correct property from what iCal expects to see as time zone information. You can find this information by selecting the Time Zone drop-down menu in the upper right corner of your iCal window and selecting Other. Once there, find the location of your Exchange server and see what the resultant time zone information looks like in iCal. In my case, I live in California and my time zone is US/Pacific or America/Los_Angeles, but the Exchange server in question lives in Dallas. So I set the property to US/Central.

I think I've built in the enough logic to grab any twisted time zone information out of the Exchange invite that Exchange can produce. And with the correct time zone information listed in the script's property, a correct iCal invite will be created and processed. If I'm wrong, let me know. You can read more about this script on my blog.

[robg adds: I haven't tested this one.]
  Post a comment  •  Comments (0)   [942 views] Email Article To a Friend View Printable Version 
Rate this hint: [ 1  · 2  · 3  · 4  · 5 ] Average rating:
Copyright © 2008 Mac Publishing LLC (Privacy PolicyContact Us
All trademarks and copyrights on this page are owned by their respective owners.
Powered By Geeklog 
Created this page in 0.30 seconds