Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Close Duplicate Finder windows Apps
I sometimes have several duplicate Finder windows open at the same time. I wrote this AppleScript which quickly closes any duplicate windows, leaving only one of each open.
script pruneDupFWins
	-- tested 07/09/12
	-- Enhanced to consider Spotlight windows 09/09/12
	-- Optimized for speed 10/09/12
	-- © McUsr 2012 Parts made by Nigel Garvey
	property parent : AppleScript
	property scriptTitle : "Close Duplicate Windows"
	property FinderIcon : a reference to file ((path to library folder from system domain as text) & "CoreServices:Finder.app:Contents:Resources:Finder.icns")
	on run
	local wCount, i, res, res2, fail, prevApp
	script o
	property wlist : {{}, {}}
	property slist : {}
	property klist : {}
	property dlist : {}
	end script
	set fail to false
	try
	tell application id "com.apple.systemevents"
	set prevApp to (name of every process whose frontmost is true and visible is true) as text
	tell application process "Finder" to set o's slist to name of every window
	end tell
	tell application id "com.apple.finder" to activate
	set sCount to count o's slist
	if sCount = 0 then return 0
	
	tell application id "com.apple.finder" to set o's wlist to {name, id} of (every window)
	
	set wCount to count item 1 of o's wlist
	set o's wlist to reverse of my transposeList(wCount, item 1 of o's wlist, item 2 of o's wlist)
	set o's slist to reverse of o's slist
	set i to 1
	repeat sCount times
	set res to my getSingelton(o's wlist, item i of o's slist)
	if res = null then
	else
	if o's klist ≠ {} then
	set res2 to my indexOfItem(item i of o's slist, o's klist)
	if res2 = 0 then
	set end of o's klist to item i of o's slist
	else
	set end of o's dlist to res
	end if
	else
	set end of o's klist to item i of o's slist
	end if
	if i < wCount then set o's wlist to items 2 thru -1 of o's wlist
	end if
	set i to i + 1
	end repeat
	
	set wcl to count o's dlist
	repeat with i from 1 to wcl
	tell application id "com.apple.finder" to close Finder window id (item i of o's dlist as integer)
	end repeat
	
	
	on error e number n
	-- Chris Stone
	set {cr, sep} to {return, "------------------------------------------"}
	set errmsg to sep & cr & "Error: " & e & cr & sep & cr & "Error 
	Number: " & n & cr & sep
	tell application id "com.apple.systemuiserver"
	activate
	try
	display dialog errmsg with title my scriptTitle buttons {"Ok"} default button 1
	end try
	end tell
	set fail to true
	set wcl to 0
	end try
	
	if not fail then
	if wcl > 0 then
	if wcl = 1 then
	set msgText to "I closed " & wcl & " window!"
	else
	set msgText to "I closed " & wcl & " windows!"
	end if
	else
	set msgText to "Nothing to do!"
	end if
	
	tell application id "com.apple.systemuiserver"
	activate
	try
	display dialog msgText with title my scriptTitle buttons {"Ok"} default button 1 with icon my FinderIcon giving up after 1.2
	end try
	end tell
	end if
	tell application prevApp to activate
	return wcl
	end run
	
	to transposeList(ctr, list1, list2)
	-- tested 05/09/12
	script o
	property newL : {}
	property m : list1
	property n : list2
	end script
	local i
	set i to 1
	repeat ctr times
	set end of o's newL to {contents of item i of o's m, contents of item i of o's n}
	set i to i + 1
	end repeat
	return o's newL
	end transposeList
	
	on indexOfItem(theItem, itemsList) -- credit to Emmanuel Levy 
	local rs
	set text item delimiters to return
	set itemsList to return & itemsList & return
	set text item delimiters to {""}
	try
	set rs to -1 + (count (paragraphs of (text 1 thru (offset of (return & theItem & return) in itemsList) of itemsList)))
	on error
	return 0
	end try
	rs
	end indexOfItem
	
	on getSingelton(the_list, item_a)
	set astid to AppleScript's text item delimiters
	-- Nigel Garvey's with a name change
	set AppleScript's text item delimiters to return
	set the_list_as_string to return & the_list & return
	set AppleScript's text item delimiters to return & item_a & return
	if (the_list_as_string contains result) then
	set p to (count paragraphs of text item 1 of the_list_as_string)
	if (p is 0) then set p to 1 -- Catch modern paragraph count for empty text.
	set p to p mod 2
	try
	set otherItem to paragraph (p * 2 - 1) of text item (p + 1) of the_list_as_string
	on error
	return null
	end try
	set AppleScript's text item delimiters to astid
	
	return otherItem
	else
	return null
	end if
	end getSingelton
	
end script
tell pruneDupFWins to run

[kirkmc adds: Looking at the script, I really don't understand much, but I tested it and it works.]
  Post a comment  •  Comments (13)  
  • Currently 3.14 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[3,124 views] Email Article To a Friend View Printable Version
Resolve problem with iTunes not recognizing iPhoto library Apps
A number of people, including some I know, have had a problem with iTunes not recognizing their iPhoto libraries, and not being able to sync them to their new iPhones. It turns out, as explained in this Apple support forum thread, that extraneous ampersand characters (&) are causing the Album Data2.xml file to be parsed incorrectly. One friend showed me that in his case it was an & in a song title. Removing the & characters seems to fix this. So if you're having problems syncing photos, this may be the reason why.
  Post a comment  •  Comments (1)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[4,848 views] Email Article To a Friend View Printable Version
Add your phone number to OS X Messages Apps
Glenn Fleishmann, writing for TidBITS, had a problem getting his phone number to work with Messages on Mountain Lion. He tried a number of things to get it to work, then finally found out that he had to log out and back in on his iPhone. He tapped Settings > Messages > Send & Receive, and then tapped Apple ID. He then tapped Sign Out, then tapped Use Your Apple ID for iMessage, and logged back in.

If you have this problem, try the above. And see the original article for more details and screenshots.
  Post a comment  •  Comments (4)  
  • Currently 3.67 / 5
  You rated: 1 / 5 (6 votes cast)
 
[12,854 views] Email Article To a Friend View Printable Version
Search the iTunes Store and Mac App Store from a browser Apps
Following yesterday's hint about dragging Mac App Store and iTunes Store icons to web browser for easier browsing, I realized that we don't have a hint about using Google to search for content in the iTunes Store or the Mac App Store. Since Apple provides all this content on the web, it's easy.

Search as follows: search_terms site:itunes.apple.com. For example, Einstein on the Beach site:itunes.apple.com. You'll get a number of hits, for the different countries where the iTunes Store or Mac App Store are available. If you want to limit the search to a specific country, you can do so like this: Einstein on the Beach site:itunes.apple.com/us/, where the two letters between the slashes are the code for the country where you're searching.

I have a LaunchBar search template set up as follows: http://www.google.com/search?q=*%20site:itunes.apple.com. You can do this in other programs as well.

Follow-up: I removed the link above; for some reason, it looks lIke I can't create a link to a Google search from here. I'll look into it.
  Post a comment  •  Comments (2)  
  • Currently 3.80 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[3,683 views] Email Article To a Friend View Printable Version
Create Outlook-like reminders for Mail with a keyboard shortcut Apps
I just read this hint, about creating Outlook-like reminders for Mail, and thought I would submit my variation on this that I created a few weeks ago. I liked the functionality of creating reminders from e-mail messages and having the link for the message in the reminder, but the requirement of dragging and dropping killed it for me.

So I created an Automator service and AppleScript that gives me the exact same result but with a keyboard shortcut so I never have to leave Mail.

Create a new Automator service.

Select "Service receives no input."

Add Get Selected Mail Items and select Messages in the drop down menu.

Add Run AppleScript and paste in the following script:

on run {input, parameters}
	
	tell application "Mail"
		set _sel to selection
		set _links to {}
		
		set the _message to item 1 ¬
			of the _sel
		set theSubject to subject of _message
		set message_id to the message id of the _message
	end tell
	
	set message_url to "message://%3c" & message_id & "%3e"
	set end of _links to message_url
	set the clipboard to (_links as string)
	
	set theBody to the clipboard
	
	tell application "Reminders"
		set theReminder to make new reminder with properties {name:theSubject, body:theBody, priority:1}
		
	end tell
	
	return input
end run
Save the service, add a shortcut, and you're done.

Here is my stackexchange post on the subject along with my solution . User Kevin Oneill provided an AppleScript that I haven't played with yet but he says it will add the body of the e-mail to the Reminder's entry which some people may prefer, since it would be viewable on an iOS device as well.
  Post a comment  •  Comments (4)  
  • Currently 3.80 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[3,160 views] Email Article To a Friend View Printable Version
Drag Mac App Store and iTunes Store icons to web browser for easier browsing Apps
Browsing the Mac App store and iTunes Store can be annoying if you're used to using tabs in your web browser. You can only view one page at a time in either store, so if you want to check out a number of items, say, after you've run a search, it's click, back-arrow, click, back-arrow…

The Finer Things in Tech web site notes a nice trick to make this easier that I hadn't thought of before. Just drag icons from the Mac App Store or iTunes Store to your web browser, or on your browser's icon in the Dock. You can see most of the same information in Safari as you can in these stores, as they are simply collections of HTML pages. If you want to view multiple items in your browser, open a new tab before dragging an icon; if not, it loads the most recently dragged icon in the frontmost tab, rather than in a new tab.
  Post a comment  •  Comments (7)  
  • Currently 3.89 / 5
  You rated: 3 / 5 (9 votes cast)
 
[3,863 views] Email Article To a Friend View Printable Version
Put a digital clock in a corner of the screen with GeekTool Apps
Since Lion, I love using my always-open apps (Chrome and iTunes) in full-screen mode, but I want to know what time is it without using the mouse or keyboard. I figured out a way to do it using a widget with GeekTool.

Making the widget
Open the application and drag a new Shell element onto the desktop. Edit it in the Properties window in this way:
In the Command section, insert date + followed without spaces by one of these commands:
%R or %H:%M to have a 24h clock;
%l:%M to have a 12h clock (put " "%p after your text if you want to show am/pm).
After that, check Keep on Top and set 1 (or less frequent value) in the Refresh every X s text field.
Now you can customize all the other properties as you want, like font, color and background; I like to use it in Lucida Grande 14 pt (the same as the system digital clock in the menu bar).

Download the widget
If you want, you can download my Geeklet by right-clicking on this text and selecting "Save link as...". It has enabled a white shadow that makes it visible over dark pages without having to set a opaque light background.

[kirkmc adds: Back in the day, I used GeekTool a lot. I didn't know it was on the Mac App Store, so if only for that, it's worth looking at. It's come a long way since I last used it, with some really interesting possibilities and much easier configuration.]
  Post a comment  •  Comments (6)  
  • Currently 3.17 / 5
  You rated: 2 / 5 (6 votes cast)
 
[4,885 views] Email Article To a Friend View Printable Version
Color a message background in Mail Apps
Although it's handy to be able to flag an important e-mail message in Mail, there is a more eye-catching method. Click to select a message, then open the Colors window by pressing Command-Shift-C. Choose your preferred color, and it will be applied to the message's background in your inbox or in a folder.

[kirkmc adds: Interesting; I see this hasn't been hinted before. In Lion, you have to actually drag the color from the top section of the window - that shows the selected color in a rectangle - onto a message. In Mountain Lion, just click on a color.

This sets the color of the background of a message; if there were a way to set the color of the text of a message, that would be interesting. I use the latter in a number of Mail rules to make specific senders and accounts stand out, and you can set the background color of messages in rules as well.]
  Post a comment  •  Comments (8)  
  • Currently 3.67 / 5
  You rated: 1 / 5 (6 votes cast)
 
[4,264 views] Email Article To a Friend View Printable Version
Share iTunes library with remote iOS device via VPN Apps
In Mac OS X 10.7, installing the Server app, enabling the VPN service, and connecting remotely with an iOS device using VPN did not provide Bonjour discovery of any home shared iTunes libraries.

A number of Bonjour redirector apps were available but none of them worked for me. So, I could not watch the movies in my home iTunes library while away from home.

Now, in Mac OS X 10.8, everything "just works." I did a fresh install of Mac OS X 10.8, installed the Server app, setup the VPN service, added my movies (stored on a Time Capsule) to iTunes (without copying the movies to the server; no need to duplicate what's already in Time Capsule), and enabled home sharing. When I connect to the server from my iPad (using a VPN connection) the native iOS "Videos" app shows my home library and I can play my movies from anywhere. It's nice to be able to play any of my movies when I'm at school or work.

My ISP only gives me a 50 Kbps upload speed, so movies play for a while, then stop, hit play and they play for another bit, then stop again. I can see this working well with maybe as little as 100 Kbps.

[kirkmc adds: I haven't tested this. Though 100 kbps isn't enough for HD movies. It's hard to know exactly how much bandwidth is needed. When I stream to my my Apple TV, it uses over 3 MBps, but that's because it's getting as much data as it can to buffer a movie.]
  Post a comment  •  Comments (19)  
  • Currently 2.50 / 5
  You rated: 5 / 5 (6 votes cast)
 
[10,530 views] Email Article To a Friend View Printable Version
Force Word and other apps to use retina display for text Apps
I found this hint on Reddit. This might interest anyone using a Retina MacBook Pro.

What you need to do is add a key to Word's Info.plist file. After you've made a backup of Word, right-click on its icon and choose Show Package Contents. Open Info.plist with a text editor, and add the following to the end of the file, just before the ≪/dict> line:
<Key>NSHighResolutionCapable</key>
<String>True</string>
Save the file. When you launch Word, OS X will attempt to run the app at Retina resolution, but since it won't find any Retina graphics only Retina fonts will be substituted.

Getting this to work is a bit tricky, and causes some glitches (at least in Word), but it's worth checking out. I think it's interesting that a plist entry in the Info.plist tells the OS whether an app supports Retina or not.

See the original post on Reddit: Force Word to use Retina Display for Text! This might also work on other programs. Click through from there to see a page with screen shots explaining the entire procedure.
  Post a comment  •  Comments (5)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (19 votes cast)
 
[5,886 views] Email Article To a Friend View Printable Version