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

Control the Finder with the Terminal UNIX
There are several ways to open a Terminal window to the current directory in the Finder. But wouldn't it be useful if you could do the reverse and open a Finder window to the current Terminal directory? Well, you can, and you can completely control the Finder from the terminal.

I have put the code on github with full instructions on how to set it up. It works by using bash_completion, .bash_profile with some applescript to control the Finder, .inputrc and .bash_aliases.

Here are some of the features:
  • Changing a directory in the Terminal opens the same directory in the Finder.
  • You can change the Finder window view from the Terminal (column, list, icon views).
  • It is case insensitve, you can press Tab for menu completion, and Shift-Tab to expand bash aliases.
  • Open a Terminal directory to the current Finder window.
This code will work with both the Terminal.app and iTerm2 and should work with older macs as well

[kirkmc adds: I haven't tested this, but it sounds very useful.]
  Post a comment  •  Comments (11)  
  • Currently 2.80 / 5
  You rated: 1 / 5 (10 votes cast)
 
[10,310 views] Email Article To a Friend View Printable Version
Display just one calendar quickly Apps
Sometimes I want to quickly disable all calendars and to display just one, for example, to see upcoming birthdays in month view.

Calendar Help says:

"To show or hide the events on all calendars, hold down the Command key while you click any calendarís checkbox in the Calendar list."

But if you hold Command and Option, then click a calendar, you achieve exactly what I want: this hide all other calendars except the one you want to see. You can then Command-click another calendar to show them all again.
  Post a comment  •  Comments (3)  
  • Currently 3.92 / 5
  You rated: 1 / 5 (13 votes cast)
 
[5,427 views] Email Article To a Friend View Printable Version
iTunes 11: Use Up Next to play one song then stop playback Apps
The AppleScript I provided previously for this doesn't work in iTunes 11, but Up Next can be used instead.

I previously submitted this AppleScript to provide a way to play one song then stop playback in iTunes. The script doesn't work in iTunes 11, but Up Next can be used instead. Also, using this method, it can be accomplished entirely from the keyboard. (It's important to note that "All controls" must be checked at the bottom of the Keyboard Shortcuts tax tab in the Keyboard pane of System Preferences.)

The objective is to be able to select a single song in a playlist, make it start playing, then prevent playback from continuing after the song has been played in its entirety. This can be done in iTunes 11 by selecting a song to play using alternating key presses of Tab, Shift-Tab, Up Arrow and Down Arrow. The next step is most important: open the Up Next list with Command-Option-U, and check to be sure no titles appear in the list (if there are any, press Tab until the "Clear" button is highlighted, then press the spacebar to "click" that button; otherwise press Escape or Command-Option-U again to exit the list), then press Return to play the song. You can pause and resume the song with spacebar if desired, and playback will still stop at the end of the song as long as you don't add anything to the Up Next list in the meantime.

[kirkmc adds: This does seem a bit complicated, but there's no way to use AppleScript to manipulate the Up Next queue, unfortunately.]
  Post a comment  •  Comments (4)  
  • Currently 3.14 / 5
  You rated: 5 / 5 (7 votes cast)
 
[8,991 views] Email Article To a Friend View Printable Version
How to make iCloud behave like Dropbox
Local copies of files you store on iCloud are stored in the Library > Mobile Documents folder in your home folder. (See this hint for more about accessing that folder.) This can be exploited to convert iCloud into a general-purpose storage and sharing resource.

This folder in your Library folder functions exactly like the Dropbox Folder on your Mac: anything stored in it will appear in the same folder on other Macs logged onto the same iCloud account. There is no restriction on what can be placed in this folder, so the data you can store and share via iCloud is not limited to files created by Apple or Apple-approved software. When you realize this, you can use iCloud as a fully comprehensive cloud resource.

Once you have stored all the files you want in your Mobile Documents folder, to avoid having to dig around to get at it, you can access it from utilities such as the free Plain Cloud . that access your Mobile Documents folder. You can periodically update your stuff by using a folder sync application such as ChronoSync. Or, to create a more sophisticated arrangement and make it run invisibly behind the scenes, you can check out Sebastian Hallum Clarke's donation-ware utilities iClouDrive, which creates a dedicated subfolder within the Mobile Documents folder, and an aliased copy of this folder on your desktop (or wherever you choose to put it), and MacDropAny, which creates symbolic links between that aliased copy and the subfolder within Mobile Documents (and also Dropbox), so that any changes you make in your local files are instantly updated on the cloud service of your choice.
  Post a comment  •  Comments (13)  
  • Currently 2.78 / 5
  You rated: 1 / 5 (9 votes cast)
 
[19,170 views] Email Article To a Friend View Printable Version
Scripts to disable and enable password for lock screen after sleep or screen saver System

Here is two small scripts that I use to set and unset the password prompt when I lock the screen, or put my Mac to sleep. It is a nuisance to have to unlock the screen by entering the password, when at home. But I wouldn't leave my Mac anywhere without it.

I have called them setScreenPassword and unsetScreenPassword. I call them from QuickSilver, and you could use another launcher to do the same. The nifty thing about Quicksilver in this matter, is that if I activate it, I can see that I have turned on setScreenPassword, as it displays the last command before I start typing again.

I prefer to see the box in the System Preference pane get clicked, and unclicked. I have an old MacBook Pro, so I have added the delay of 0 so you can see where to add increments of 0.2 seconds, until you see the check box gets checked, or unchecked.

script EnablePasswordPrompt
	tell application "System Preferences"
		tell anchor "General" of pane "com.apple.preference.security" to reveal
		activate
	end tell
	tell application id "sevs"
		set UI elements enabled to true
		set a to value of checkbox 2 of tab group of window 1 of application process "System Preferences" as integer
		if a = 0 then
			tell checkbox 2 of tab group of window 1 of application process "System Preferences" to click
		end if
	end tell
	delay 0
	tell application "System Preferences" to quit
end script
tell EnablePasswordPrompt to run

---------------------------------------------
script disablePasswordPrompt
	tell application "System Preferences"
		tell anchor "General" of pane "com.apple.preference.security" to reveal
		activate
	end tell
	tell application id "sevs"
		set UI elements enabled to true
		set a to value of checkbox 2 of tab group of window 1 of application process "System Preferences" as integer
		if a = 1 then
			tell checkbox 2 of tab group of window 1 of application process "System Preferences" to click
		end if
	end tell
	delay 0
	tell application "System Preferences" to quit
end script
tell disablePasswordPrompt to run
  Post a comment  •  Comments (13)  
  • Currently 1.60 / 5
  You rated: 2 / 5 (5 votes cast)
 
[9,875 views] Email Article To a Friend View Printable Version
iTunes 11: Change music files to podcasts Apps
After upgrading to iTunes 11, I found it was impossible to change added files from music to podcasts.

A couple of podcasts I listen to that have subscriptions, but only one of them automatically downloads to iTunes. The other one requires me to go to the website, log in, and manually download the file.

What I then used to do was add it to iTunes by double-clicking it, then I'd stop the playback and get info on the track. I would add the show's info (which was missing), and then set it to remember playback position, skip when shuffling, and set its Media Type to Podcast. Since the Artist and Album matched the other files for that podcast, it would end up in that folder, and behave like any other podcast.

With iTunes 11, I can no longer change the file's type to Podcast. It always reverts to music. I can make it an audiobook, or any other type of media, but not a podcast.

This was annoying to say the least. So I went looking for a way to do this, and found a small free app called Typecast from Red Sweater Software.

With Typecast, you drop the mp3 file onto the app's window, enter the name of the podcast, and it sets the Media Type to podcast, and adds it to iTunes. It makes a new podcast for each file you add, even though they are the same podcast, but it shows up under the main list on my iPod, and that's what I wanted.

I don't know if this is an iTunes bug, but this is a workaround.

[kirkmc adds: Yes, it's a bug, and I assume that it will be fixed in the next update, but in the meantime, I think a lot of people will benefit from this hint.]
  Post a comment  •  Comments (5)  
  • Currently 3.40 / 5
  You rated: 3 / 5 (10 votes cast)
 
[10,397 views] Email Article To a Friend View Printable Version
How to reset Lion back to the Setup Assistant Install
There have been previous hints on how to reset earlier versions of Mac OS X to delete users so that it boots to the Setup Assistant again. This can be useful if you are passing on or selling your computer to someone else. The most recent hint was posted in 2007 for Mac OS X 10.5 and there were significant corrections included in the comments. There is also a command that changed in 10.7 (also in the older hintís comments) and even with the modifications suggested in the comments, the hint is still incomplete.

So instead of adding yet another modification in the comments of a hint related to 10.5, I thought I would submit a new hint brining everything together from the old hint, its comments, changes needed for 10.7, and the missing items I have found. This provides a current version of the hint for 10.7 and presumably 10.8, though I have not been able to test on Mountain Lion.

1: Remove references to, and the stored passwords for, your local WiFi network.
  • In the Finder, choose Go > Utilities.
  • Open Keychain Access in the Utilities folder.
  • If you donít have a list of keychains on the left, choose View > Show Keychains.
  • On the keychains list on the left, select the System keychain. There should be an AirPort network password item in the list for your local WiFi network. Select it and press Delete. Confirm that you want to delete the item and quit Keychain Access.
  • Go to System Preferences > Network
  • Select Wi-Fi from the list on the left and click the Advanced button on the bottom right.
  • In theĎPreferred Networks: list, select your network and click the minus button below the list.
  • Click OK and then Apply button in the main Network Preferences window.
  • Click Turn Wi-Fi Off, then click it again to turn Wi-Fi back on. It should not connect to your network anymore (and should ask for a password if you try).
2: Still in System Preferences, click Show All at the top left and then click the Users & Groups icon. Delete all users except for the one you are currently logged in as. In the rest of this hint, this remaining user will be referred to as USERNAME.

3: Boot your Mac into single user mode by restarting and holding down Command-S at startup.

4: Mount the filesystem in write mode and delete the USERNAME home directory.
$ mount -uw /
$ rm -R /Users/USERNAME/


5: Load OpenDirectory so we can remove the systemís record of USERNAME.
$ launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist

6: Find the UID of USERNAME.
$ dscl . -read /Users/USERNAME GeneratedUID
In the next step, type in this UID where you see GENERATEDUID written.

7: Remove USERNAME from the systemwide admin group and then remove USERNAMEís record.
$ dscl . -delete /Groups/admin GroupMembers GENERATEDUID
$ dscl . -delete /Groups/admin GroupMembership USERNAME
$ dscl . -delete /Users/USERNAME


8: Remove the Setup Assistant flag so that it runs when the Mac is started up.
$ rm /var/db/.AppleSetupDone

9:[optional] Remove the cache files and virtual memory swapfile.
$ rm -R /Library/Caches/*
$ rm -R /var/vm/swapfile*


10: $ shutdown -h now

If you want to check that the Setup Assistant will run, you can turn on your Mac. When the Setup Assistant starts, just press cmd-Q on the keyboard and you will be prompted to shut down. Your Mac has been reset.

[kirkmc adds: I'm running this hint because it contains a lot of useful information. But I wonder why one can't simply erase the hard disk and re-run the installer to get everything back to its initial state. That seems a lot easier to meÖ]
  Post a comment  •  Comments (18)  
  • Currently 3.15 / 5
  You rated: 1 / 5 (13 votes cast)
 
[32,603 views] Email Article To a Friend View Printable Version
iTunes 11: Add tracks from shared library to Up Next Apps
If you use Home Sharing and have multiple libraries on your network, you can add tracks from a shared library to Up Next. Just mount a shared library, then drag a track from that library to the Up Next list or icon. You can add single or multiple tracks, and re-order them in the Up Next queue, as long as the library remains available.
  Post a comment  •  Comments (0)  
  • Currently 2.50 / 5
  You rated: 1 / 5 (6 votes cast)
 
[5,537 views] Email Article To a Friend View Printable Version
iTunes 11: Keyboard shortcut to add songs to Up Next queue Apps
We posted two ways to quickly add songs to the Up Next queue in iTunes 11, but there's also a keyboard shortcut you can use. Select one or more songs, then press Option-Return. This adds the songs to be played next.
  Post a comment  •  Comments (2)  
  • Currently 3.78 / 5
  You rated: 4 / 5 (9 votes cast)
 
[8,676 views] Email Article To a Friend View Printable Version
iTunes 11: Downgrade to iTunes 10.7 Apps
iTunes 11 has been very controversial, and many people are disappointed with its limited viewing options, and are looking for ways to downgrade to iTunes 10.7, the previous version. This is possible, yet it is a bit complex. This thread on StackExchange shows what you need to do to be able to downgrade, though it assumes you have a Time Machine backup or other recent clone of OS X, because it requires restoring certain frameworks in addition to the iTunes application itself.

If you do this, make sure you back up your entire system, and make sure to read the entire thread to see certain problems that may occur.
  Post a comment  •  Comments (15)  
  • Currently 3.14 / 5
  You rated: 4 / 5 (7 votes cast)
 
[22,987 views] Email Article To a Friend View Printable Version