The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   get-omnifocus.sh version 1.0 released (http://forums.omnigroup.com/showthread.php?t=4258)

luomat 2007-07-21 11:20 AM

get-omnifocus.sh version 1.0 released
 
In response to a request in this thread:

[url]http://forums.omnigroup.com/showthread.php?t=4245[/url]

I am releasing a shell script that I have written which downloads and installs the latest version of OmniFocus.

Use at your own risk. Really. I mean it.

Here's the installation process. NOTE: you will need to be at least a little comfortable editing text files and using Terminal.app to make this work.


1) Write this down: "I <insert name here> do solemly swear that I am solely responsible for my own actions and hereby take full responsibility for whatever this script does to my data, my love life, and the acne on my back."

2) Sign it, Date it, and Post it on wall above monitor

3) download

[url]http://tj.tntluoma.com/files/get-omnifocus.sh[/url]

(Note: Safari calls it an "Application")

4) Open the file in a text editor (such as BBEdit or TextWrangler -- NOT Microsoft Word or any other app which might convert it from plain text)

5) Read over the parts at the top. You will need to enter the username and password that you use to download OmniFocus. If you don't have that, search your email archive.

You need to change, AT MINIMUM, three lines, which begin with

EULA=

LOGIN=

PASSWORD=

And a 4th if you have installed OmniFocus anywhere other than /Applications/ such as ~/Applications/

6) Save the file to your Desktop (it may already be saved there, but you need to make sure you save your changes)

7) Open Terminal.app

8) Read the note posted on the wall above your monitor

9) Type this (I recommend that you copy and paste each line to avoid typos)

mkdir -p ~/bin/

cd Desktop

chmod 755 get-omnifocus.sh

mv -i get-omnifocus.sh ~/bin/

10) That will 'install' the script. To run it, simply type:

~/bin/get-omnifocus.sh

and watch what it says.


NOTE: Do *NOT* use this script in 'cron' or some other automated way. If you want to know when the newest builds are available, follow the RSS feed at

[url]http://www.omnigroup.com/appcast/?title=OmniFocus&release_track=sneakypeek[/url]


If the sign over your monitor didn't make it abundantly clear, you are using this entirely at your own risk.

All I will say is that I have been using it for a couple of weeks without any problems. I just added a bit more error catching code before posting it here.

A few more notes:

The script tries to make sure that OmniFocus is not running before it installs a new version. It can, however, safely check to see if there is a new version while OmniFocus is running. It will just not do the install until you manually quit OmniFocus.

When a new version is found, the old version is moved to your Recycle Bin with the build number attached. For example if you were using build 1100 and build 1200 came out, build number 1200 would get installed and in your Recycle Bin you would see:

OmniFocus.1100.app

which tells you what build it was in case you need to downgrade OmniFocus (just don't empty your trash until you make sure the new version works :-)

Please post questions and comments back to this thread

SpiralOcean 2007-07-21 11:31 AM

Dude! You win my hero of the week!

Very cool.

One problem...
Fatal error. There already appears to be a program installed at /Applications/OmniFocus.app

The application downloaded correctly.
I have two user accounts.
Admin
myUser

I usually have to authenticate to install. I'm assuming this script will handle that? Maybe that is why this error is appearing?

This should probably be posted in the OmniFocus Extras forum.

SpiralOcean 2007-07-21 11:40 AM

Another suggestion...

using iCal, I can schedule an event to fire off every night... or hour or whatever time. I can use iCal to open the .sh file. (I have to use TinkerTool to make hidden files visible first).

What would you think about modifying the script, so that when the script runs... it checks for a newer version, downloads it, mounts the disk image, and then asks prompts to quit OF. That way, if the script is stalled, the newer version has still downloaded and all I have to do quit OF, drag the newer version to applications & authenticate.

luomat 2007-07-21 11:52 AM

[QUOTE=SpiralOcean]Another suggestion...

using iCal, I can schedule an event to fire off every night... or hour or whatever time. I can use iCal to open the .sh file. (I have to use TinkerTool to make hidden files visible first).

What would you think about modifying the script, so that when the script runs... it checks for a newer version, downloads it, mounts the disk image, and then asks prompts to quit OF. That way, if the script is stalled, the newer version has still downloaded and all I have to do quit OF, drag the newer version to applications & authenticate.[/QUOTE]

The new version IS downloaded before you are prompted to quit OmniFocus.

I did this explicitly because I'm used to working on a slow connection where OmniFocus might take 30 minutes to download.

So you can run it whenever you want and it will wait for you to quit OmniFocus.

However, my suggestion is to quit OmniFocus before you go to bed.

Why?

Alpha programs often have memory leaks (I don't know that OF does, just saying it's possible).

Also, then when you come to the computer in the AM it will be waiting with an EULA.

How long does it take OF to download for you? If it's not too long I'd just suggest that you make updating it the first thing you do in the morning. Otherwise the OmniGurus may have released ANOTHER version since the time you started this. That's why I recommend not automating the download.

SpiralOcean 2007-07-21 12:00 PM

You are right about the automation... I was thinking of having it check every min for a new version and then downloading... I'm sure thee omnions would love for everyone to do that... ;)

Running the app in the morning is probably what I'll do.

Nice job on the application... It's perfect the way it is. :)

luomat 2007-07-21 12:02 PM

[QUOTE=SpiralOcean]
One problem...
Fatal error. There already appears to be a program installed at /Applications/OmniFocus.app

The application downloaded correctly.
I have two user accounts.
Admin
myUser

I usually have to authenticate to install. I'm assuming this script will handle that? Maybe that is why this error is appearing?
[/QUOTE]

Yes, that's entirely likely. If your user doesn't have permission to

move /Applications/OmniFocus.app to ~/.Trash/

copy /Volumes/OmniFocus/OmniFocus.app to /Applications (or wherever you have it installed)

then it won't work

The easiest way to get around this would be to use 'sudo'

sudo get-omnifocus.sh

and then enter your admin password. I'm not sure about the potential security implications of that, so again, use at your own risks. You could also put various 'sudo' calls in the script, but the problem is that you might have to enter your password several times depending on how long it took to download, etc.

Another option (probably safer) is to put OmniFocus in ~/Applications instead of /Applications/

Are there multiple people on your computer using OmniFocus? If not, ~/Applications/ would be a good choice. You don't need to use sudo for that.

Given that the final version will probably make this script completely obsolete, I'd use ~/Applications/ in the short term



[QUOTE=SpiralOcean]
This should probably be posted in the OmniFocus Extras forum.[/QUOTE]

I didn't reaize there were two forums for OF.

luomat 2007-07-21 12:09 PM

[QUOTE=SpiralOcean]You are right about the automation... I was thinking of having it check every min for a new version and then downloading... I'm sure thee omnions would love for everyone to do that... ;)[/QUOTE]

Enough people do that and I suspect that I'd find myself bound, gagged, and thrown into the river with cement handcuffs, and the last thing I'd hear is "Ken Case says hello."

[QUOTE=SpiralOcean]
Running the app in the morning is probably what I'll do.
[/QUOTE]

Here's my morning ritual:

1) Shut off alarm
2) Open MacBook
3) run 'get-omnifocus.sh'
4) Go to the bathroom, brush teeth, etc
5) Click on EULA
6) Launch OmniFocus

Hrm.

That made me realize something....

I just added

open -a OmniFocus

to the script (at the very bottom, right above 'exit 0' and 'eof') so the script will launch OmniFocus when it's done :-)

SpiralOcean 2007-07-21 12:55 PM

[QUOTE=luomat]Enough people do that and I suspect that I'd find myself bound, gagged, and thrown into the river with cement handcuffs, and the last thing I'd hear is "Ken Case says hello."
[/QUOTE]

Yes... Ken Case doesn't read books. He stares them down until he gets the information he wants.

SpiralOcean 2007-07-21 04:38 PM

I've also heard...
The boogeyman checks for Ken Case under his bed before going to sleep.

Lizard 2007-07-21 10:58 PM

[QUOTE=luomat]
I didn't reaize there were two forums for OF.[/QUOTE]

Hope you don't mind that I've relocated it for you.


All times are GMT -8. The time now is 03:45 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.