Thursday, May 28, 2015

Open Dropbox folder from anywhere in Mac OSX

Hi folks,  here's a method that I implemented that allowed opening the Dropbox folder from within any application (well, it gets called by a Terminal session from the Finder).

This does not however, automatically switch to the Dropbox folder while in the middle of a application dialog box;  it simply opens up the Dropbox folder in the event you need to look into or open something within the Dropbox folder.  To access the Dropbox folder from an application dialog box, you can drag the Dropbox folder into the "Favorites" section of the application save/open dialog box to access it within one click.

Ok, if you're still interested in a hot-key anyway to access the dropbox folder,
here's how to do it:

1. Open Automator: [Cmd]-[Spacebar], type in Automator.

2. Select Service, click Choose

3. Modify Service receives selected [text] in [any application] to  Service receives [no input] in [any application].

4. Select the action Run Shell Script under Utilities, drag it over to the right pane.

5. Change the cat command to open ~/Dropbox .  If your Dropbox folder is located somewhere else, please modify the pah accordingly.

6. Save as Open Dropbox Folder within Automator.

7. Open System Preferences: [Cmd]-[Spacebar], type in System Preferences .

8. Navigate to Keyboard -> Shortcuts

9. Scroll down to General

10. Ensure the checkbox for Open Dropbox Folder is checked (enabled).

11. Choose the Keystroke combination to open the Dropbox folder.
NOTE:  If you choose [Option]-[Cmd]-[D], you may need to disable Turn Dock Hiding On/Off in the Launchpad  & Dock section.


Enjoy!

Thursday, May 21, 2015

Set alias options to dynamically change JAVA_HOME to particular JDK in Mac OSX (Yosemite)

Add the following to ~/.zshrc  or ~/.bashrc:

#Set alias options to dynamically change JAVA_HOME to particular JDK
alias jdk16 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) '
alias jdk17 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) '
alias jdk18 = ' export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) '



Re-source the rc file to pickup changes on the terminal:
$source ~/.zshrc or ~/.bashrc



Sourced from:
http://apple.stackexchange.com/questions/135058/i-installed-oracle-java-jdk-8-but-java-command-line-is-still-reporting-it-is-ver

Monday, May 18, 2015

Fix for when iMessage on Mac OSX no longer displays SMS/iMessage photos

Thanks to Ralph Johns for the info on the fix!  Here's a quick and dirty script that can help fix iMessage if it stops displaying jpeg files in Mac OSX (Yosemite*):


$cat fix_imessage.sh
#!/bin/bash

# Set file/paths to check
file_attach='~/Library/Messages/Attachments'
file_symlnk='~/Library/Containers/com.apple.iChat/Data/Library/Messages/Attachments'
target_symlnk='../../../../../Messages/Attachments'

#Start checking
echo Checking $file_attach...
if [ -d $file_attach ]
then
        echo $file_attach is already a folder.
fi

if [ -f $file_attach ]
    then
        echo $file_attach is an unexpected file. Fixing...
        echo Renaming Attachments to Attachments.old...
        mv $file_attach $file_attach".old"
        echo "Creating new Attachments folder..."
        mkdir -m770 $file_attach
fi

echo Checking symlink dependencies...
if [ -h $file_symlnk ]
    then
        echo $file_symlnk symlink ok.
    else
        echo $file_symlnk symlink broken.  Fixing...
        mv $file_symlnk $file_symlnk".old"
        ln -sf $target_symlnk  $file_symlnk
fi

echo Done.
echo Exiting.
exit



*NOTE:  Only tested on OSX Yosemite.  May or may not work on other versions of OSX.