Thursday, September 19, 2013

More Mac Tips and Tricks

Google Chrome and F5

So for some reason Google Chrome in OSX does not support F5 for refresh. This is easy to fix it turns out:
  1. Open System Preferences > Keyboard > Keyboard Shortcuts
  2. Click on Application Shortcuts in the Left Pane
  3. Click the + button, select Google Chrome as the Application and enter "Reload This Page" as the menu title
  4. Highlight the Keyboard Shortcut field and press F5
Source: http://productforums.google.com/d/msg/chrome/If0TdQ2m6hU/ZSrbu8BCDpwJ (Instructions for Lion are above)

Games on a Mac and Hot Corners

I have Hot Corners enabled on my Mac. When I try to play a Full Screen game, the Hot Corners keep activating. I searched for some way to disable Hot Corners quickly, but none exists. However, it seems this can be done using AppleScript. What it involves is creating an AppleScript that disables and reenables your Hot Corners on the basis of your input. There are a couple of glitches with this: firstly, if you want to modify the Hot Corners configuration to be something different, you have to modify the AppleScript and if you want to setup a Hot Corner to show Notification Center, then it doesn't work via AppleScript.

Here's the AppleScript I ended up using:
repeat
 activate
 
 
 set question to display dialog "Do you Want to Enable Hot Corners?" buttons {"Yes", "No", "Cancel"} default button 3
 set answer to button returned of question
 
 if answer is equal to "No" then
  tell application "System Events"
   activate
   if UI elements enabled then
    tell expose preferences
     set properties of the top left screen corner to {activity:none, modifiers:{}}
     -- set properties of the top right screen corner to {activity:none, modifiers:{}}
     set properties of the bottom left screen corner to {activity:none, modifiers:{}}
     set properties of the bottom right screen corner to {activity:none, modifiers:{}}
    end tell
   else
    tell application "System Preferences"
     activate
     set current pane to pane "com.apple.preference.universalaccess"
     display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
    end tell
   end if
  end tell
  return
  
 end if
 
 if answer is equal to "Yes" then
  tell application "System Events"
   activate
   if UI elements enabled then
    tell expose preferences
     set properties of the top left screen corner to {activity:all windows, modifiers:{}}
     -- set properties of the top right screen corner to {activity:show desktop, modifiers:{}}
     set properties of the bottom left screen corner to {activity:«constant ****lpad», modifiers:{}}
     set properties of the bottom right screen corner to {activity:dashboard, modifiers:{}}
    end tell
   else
    tell application "System Preferences"
     activate
     set current pane to pane "com.apple.preference.universalaccess"
     display dialog "UI element scripting is not enabled. Check \"Enable access for assistive devices\""
    end tell
   end if
  end tell
  return
  
 end if
 
 if answer is equal to "Cancel" then
  return
  
 end if
 
end repeat

Some useful links on the same:

  • My original inspiration: https://gist.github.com/klynch/827581
  • The repeat comes from here: http://dev.dota2.com/showthread.php?t=102450
  • General Scripting Guidelines: http://macscripter.net/viewtopic.php?id=24773
  • And some more: http://www.macosxautomation.com/applescript/features/system-prefs.html

Saturday, September 7, 2013

Back Again - After 3 years!

Wow - its been 3 years since my last blog post. Wasn't expecting a wait this long :)

Mostly its been a bit difficult to find things to write about and considering a lot of what you do at a big company is confidential I could use that as an excuse to say I couldn't speak - but then some of the things I worked on have gone Open Source so can't really take that excuse. I guess mostly the reason was I switced to using FB and Twitter and there just wasnt a reason to blog anymore.

My dad recently go onto FB and I setup a blog for him. Check it out here: http://arvind.vashisht.net. For a while I had replaced the G+ comments on his blog with FB comments (so my dad is a registered developer now - Ha Ha. Stupid FB only allows FB comments on a blog if you register it as a Application) That made me think of my own long forgotten blog.

So I recently switched to a Mac at work and since I want to keep track of everything I am doing to solve issues, here goes my first entry in 3+ years :)

Getting Tata Photon Working
  • Download the drivers from here: http://www.tatadocomo.com/tata-photon-download-dialer.aspx
  • See this post here for more details: https://discussions.apple.com/message/18139781#18139781
Keyboard Shortcuts

Some useful links
  • http://support.apple.com/kb/ht1343
  • http://www.danrodney.com/mac/index.html
  • http://www.hcs.harvard.edu/~jrus/Site/System%20Bindings.html
  • http://guides.macrumors.com/Keyboard_shortcuts
Setup Windows File Transfer

So Mac OSX Lion has replaced Samba with their own implementation. Also for some reason IT hates domain users sharing files. The solution - create a new user, with Sharing Only privileges. Add a group for the new user and add yourself and the new user to that group. Grant the new group access to your home folder (use the Gear Icon in Finder's Info box to add permissions to subfolders also) and then share away. I have found OSX is quite slow while transferring files. The solution: http://www.digitalgatehouse.com/speed-up-your-mac-os-x-with-smbwindows-servers-255

Outlook on Mac

Now this thing is amazingly painful. Outlook on Mac is general 70% functional. You can't insert tables in EMails - pretty much every advanced action requires you to edit in Word and then Share as HTML EMail. I also hate Outlook reminders, so I sync the Outlook calendar with the system calendar via Outlook Sync Services. One thing I found to be more powerful than Outlook on Windows is the search capability. Outlook is integrated with Spotlight search on Mac. This means you can find all sorts of useful metadata tags on messages. Open the Search Menu, select Advanced > Raw Query and you can enter all sorts of queries. For e.g this one finds all pending meeting invites:
com_microsoft_outlook_has_reminder = 1 && com_microsoft_outlook_author_email_addresses != *_YOUR_EXCHANGE_ID_@* && com_microsoft_outlook_recpient_email_addresses = *_YOUR_EXCHANGE_ID_@* && kMDItemDisplayName != Accepted:* && kMDItemDisplayName != Declined:* && kMDItemDisplayName != *Notification:*

Some useful links:
  • http://verveguy.blogspot.in/2013/02/outlook-2011-mac-smart-folders.html
  • http://blog.stevex.net/2011/03/outlook-2011-smart-folder-with-raw-query/
  • http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macoutlook/outlook-2011-raw-query-syntax-question/5148b454-38d5-481f-bc6c-dbd19948c6ed?msgId=b8ee2e62-bac5-4c1d-922c-f61f4e0205c4
  • https://developer.apple.com/library/mac/documentation/Carbon/Reference/MDItemRef/Reference/reference.html