Inbox by Gmail – making a small application

dockemailgmailgooglegoogle-chrome

Google have come up with a really good service at Inbox. I find it very easy to manage email that way and have been using it on my Windows PC as a chrome application for a lot of time.

Recently, I bought a MacBook Pro and just plain hate the default mail application they have installed. Also, since I own an Android phone and I use the Inbox Android Application there, it's really hard to see what I did in inbox reflected on Mail (see footnote)

My problem is that when I install the Inbox chrome extension, it is little more that a glorified shortcut. On my Windows PC, I used to select 'Open as a separate Window' and I didn't need to use Chrome at all. However, on the Mac there is no such option and it opens Chrome every time I open Inbox (on top of that I cannot pin the application to the Dock like I used to be able to with the Taskbar). So the question is whether I can make a small application that I can pin to the Dock, which opens a fullscreen window showing the contents of the Inbox website.

I am a Mac newbie so please forgive me for any noobie things I said. Any help would be greatly appreciated!

(footnote) For example, you can mark an email as 'Done' in Inbox. Now I don't know where that email disappears on my Mac.

Best Answer

You can try Fluid -- it can create one off, WebKit "applications" that look a bit like native applications though are actually single web pages running in a de-decorated WebKit browser window. I've used it successfully in the past for things like Fogbugz.

Fluid may not work though since Inbox requires Chrome and I'm not sure Fluid will identify the browser in a way that'll let Inbox work. It may complain it's not running in Chrome.

If that's the case, here is a shell script that will create a standalone Chrome "app" for you similar to how Fluid works, but with the underlying engine for the app being Chrome. I haven't it used it, but the idea and implementation look sound. You should fork that gist if you're going to use -- gists can disappear. The script, recreated here, for reference is:

#!/bin/sh

echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"

echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"

echo "What is the full path to the icon (e.g. /Users/username/Desktop/icon.png)?"
read inputline
icon="$inputline"

chromePath="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
appRoot="/Applications"

# various paths used when creating the app
resourcePath="$appRoot/$name.app/Contents/Resources"
execPath="$appRoot/$name.app/Contents/MacOS" 
profilePath="$appRoot/$name.app/Contents/Profile"
plistPath="$appRoot/$name.app/Contents/Info.plist"

# make the directories
mkdir -p  "$resourcePath" "$execPath" "$profilePath"

# convert the icon and copy into Resources
if [ -f "$icon" ] ; then
    sips -s format tiff "$icon" --out "$resourcePath/icon.tiff" --resampleHeightWidth 128 128 >& /dev/null
    tiff2icns -noLarge "$resourcePath/icon.tiff" >& /dev/null
fi

# create the executable
cat >"$execPath/$name" <<EOF
#!/bin/sh
exec "$chromePath"  --app="$url" --user-data-dir="$profilePath" "\$@"
EOF
chmod +x "$execPath/$name"

# create the Info.plist 
cat > "$plistPath" <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" “http://www.apple.com/DTDs/PropertyList-1.0.dtdâ€>
<plist version=â€1.0″>
<dict>
<key>CFBundleExecutable</key>
<string>$name</string>
<key>CFBundleIconFile</key>
<string>icon</string>
</dict>
</plist>
EOF