The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   OF iPhone HTML Export Script (http://forums.omnigroup.com/showthread.php?t=5152)

wkoffel 2007-10-11 08:19 PM

OF iPhone HTML Export Script
 
Hey folks. I've been using a custom script for a few weeks now that exports my OF tasks to a simple HTML file that's iPhone-friendly. Basically, I trigger it via a hotkey on my laptop, it exports the HTML file, and then transfers it up to my public webserver, where I can access it from anywhere via Safari on the iPhone. It's not a full interface, just a read-only view, which is totally sufficient for things like checking my errands list on my way home from work, etc.

I figured with the recent demise of the official OF iphone support, it made sense to share my early work on this. Of course, this was way more useful to me anyway, since my laptop is not an always-on webserver, nor do I want to punch holes in my home firewall.

So a skeleton of my script can be found at:

[url]http://fountainsoft.com/mac/of_iphone_export_sample.rb[/url]

I hadn't actually looked at the OF iPhone rails app until after I wrote this, but it turns out they are using a similar technique, namely grabbing the OF data using AppleScript hooks from ruby. I then use another ruby library to help generate markup that's compatible with the IUI examples from [url]http://www.joehewitt.com/iui/[/url]

This script is not really a production-ready package. But if you'd like to try to run it, you'll run a couple one-time setup steps:

- install rubygems. If you have something like macports, try "port install rb-rubygems" in your terminal (you should already have ruby on your mac by default)
- "sudo gem install markaby"
- "sudo gem install rb-appscript"

Then to run the script, simply save it somewhere (we'll assume Desktop for now), and type:
- "~/Desktop/of_iphone_export_sample.rb"

And it will dump an HTML file to your desktop that you can put where you please.

My actual script varies in a few ways:
- Instead of dumping the results to a file on the desktop, I create a temp file and then have some more lines of ruby that upload it using SCP and ssh-agent managed keys to my webserver automatically.
- I changed the paths for iui.js and iui.css to reference a location on my target machine, so I don't hammer Hewitt's unofficially hosted IUI files.
- I make some calls out to the shell to show Growl notifications for the start and finish of the export, so I have some visual cue that it's working.
- I use Quicksilver to trigger an applescript that calls this ruby script using a hotkey, so I get one-keystroke access to the export whenever I've been updating my GTD.

Hope this is of at least a passing interest to some iPhone users out there. If there's a lot of interest, I would consider updating it somewhat, to make it more user-friendly, create a helpful installer, something like that. Alternatively, if the OmniGroup wants to run with an idea like this instead of a dedicated server, go for it!! You guys have the resources I don't to make a solution like this work better. One obvious solution would be to publish such an export to a .Mac account for easy viewing on-the-go.

-Will

wkoffel 2007-10-12 06:25 AM

Note, when you run the script, you either need to make it executable, or alternatively, just run

"ruby ~/Desktop/of_iphone_export_sample.rb"

Sorry for the confusion.

haraldmartin 2007-10-15 02:49 AM

Great!
With this script as a base, I changed/added some functionality to make if work offline (without EDGE/Wifi on iPhone)

1. Generate a html page with from OF (your script)
2. Convert the html output to a DATA URI using the [URL="http://http://www.insanelygreattees.com/FilemarkMaker/FilemarkMakerSource.zip"]Perl version[/URL] of [URL="http://www.insanelygreattees.com/news/?p=51"]FileMarkMaker[/URL]
3. Convert Safari's Bookmark.plist to to plain text/xml
4. Replace the current Todo-list bookmark with the new bookmark
5. Save Bookmarks.plist file and convert it back to binary.

Then your tasks should be syncable only by running one script (which could be a toolbar button in OF or set as a QuickSilver trigger or a run as a Cron/Launchd job etc)

I'll test it some more and then post it here. Right now it would only work if you have one data-uri in your bookmarks but that shouldn't be too hard to fix.

RuleRulez 2007-10-30 12:54 AM

I've tried to install Rubgems on Leopard. No success.

Any hints?

haraldmartin 2007-10-30 03:48 AM

@RuleRulez: Ruby and Rubygems are already installed by default in Leopard. try "gem list" in Terminal and you will see. Install new gems like you did before, sudo gem install mygem

granin 2007-11-03 02:58 AM

this script seems to be amazing! but i can't install it, on leopard i'm stuck with installing : "sudo gem install rb-appscript" ,
I get this:
pc20:~ misha$ sudo gem install rb-appscript
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install rb-appscript
can't find header files for ruby.

curt.clifton 2007-11-03 06:26 AM

I'm not running Leopard yet, but I wonder if you need to install the Developer Tools for the native extensions build to work. Have you installed the Developer Tools for Leopard?

haraldmartin 2007-11-09 08:22 AM

OmniFocus → iPhone script for offline viewing
 
2 Attachment(s)
Hi

here is the script I've been using for a week or two to export my OF tasks into a Safari (data)bookmark to make my tasks available even when I'm offline.

The html export script is based on the script in the beginning of this thread but I had to simplify the html a bit (and remove almost all javascript) since Safari seems to have problems with it when used as a bookmark.

I'm running this script as a Launch Agent every second hour, configured using [URL="http://macupdate.com/info.php/id/19879/lingon"]Lingon[/URL] so the bookmark/data is up to date the next time I'm syncing my iPhone.

Please backup you bookmarks and other data before running it. I'm not responsible for any data loss, so please be careful.

Installation:
[LIST=1][*]Unzip the files wherever you like[*]Create a new bookmark in Safari with address "data:text/html". Choose a name you like (mine is "ToDo")[*] Make sure you have Apple's Developer Tools installed (can be found at [URL="http://developer.apple.com"]developer.apple.com[/URL] or on your OS X installation disk[*] If you're not on Leopard, install [URL="http://rubygems.org"]Rubygems[/URL][*] Install the markaby gem: "sudo gem install markaby" from the Terminal[*] Install the appscript gem: "sudo gem install rb-appscript" from the Terminal[*]Run the .app script and see if your tasks get exported[/LIST]
Make sure you have set iTunes to sync Safari's bookmarks.
The script is kind of a hack so you might need to fix it (like change the path to growlnotify) but it works for me like this.

Note: It's the .app or the ruby (.rb) script you should use, the other files (css, js etc) are just helpers.

[URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]Get it here[/URL]

Tinchohs 2007-11-09 04:32 PM

I got the following error...
 
1 Attachment(s)
[QUOTE=haraldmartin;24238]Hi

here is the script I've been using for a week or two to export my OF tasks into a Safari (data)bookmark to make my tasks available even when I'm offline.

The html export script is based on the script in the beginning of this thread but I had to simplify the html a bit (and remove almost all javascript) since Safari seems to have problems with it when used as a bookmark.

I'm running this script as a Launch Agent every second hour, configured using [URL="http://macupdate.com/info.php/id/19879/lingon"]Lingon[/URL] so the bookmark/data is up to date the next time I'm syncing my iPhone.

Please backup you bookmarks and other data before running it. I'm responsible for any data loss, so please be careful.

Installation:
[LIST=1][*]Unzip the files wherever you like[*]Create a new bookmark in Safari with address "data:text/html". Choose a name you like (mine is "ToDo")[*]Run the .app script and see if your tasks get exported[/LIST]
Make sure you have set iTunes to sync Safari's bookmarks.
The script is kind of a hack so you might need to fix it (like change the path to growlnotify) but it works for me like this.

Note: It's the .app or the ruby (.rb) script you should use, the other files (css, js etc) are just helpers.

[URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]Get it here[/URL][/QUOTE]

Thanks SO much for posting this. I got an error that I am attaching. I am running Leopard, so I am unsure if it's related to this. Any suggestions? Thanks SO much again... Martin.

haraldmartin 2007-11-10 01:20 AM

Sorry, forgot to add this to the installation instruktions. Make sure you have Apple's Developer Tools installed (they're free on your OS X installation disk or on developer.apple.com). Then you'll need to install two gems to make it work. Just do this in the Terminal (Applications → Utilities → Terminal):

If you're not on Leopard, you'll need to make sure [URL="http://rubygems.org"]Rubygems[/URL] is installed. Then install the gems needed:

sudo gem install markaby
sudo gem install rb-appscript

Ciao
Martin

granin 2007-11-10 06:46 AM

[QUOTE=haraldmartin;24306]Sorry, forgot to add this to the installation instruktions. You'll need to install to gems to make work, just do this in the Terminal (Applications → Utilities → Terminal):

sudo gem install markaby
sudo gem install appscript

Ciao[/QUOTE]
Please correct:
1st ocmmand worked but last one should be:
[CODE]sudo gem install rb-appscript[/CODE]
otherwise you'll get:
[CODE]computer:~ misha$ sudo gem install appscript
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find appscript (> 0) in any repository
computer:~ misha$
[/CODE]

Tinchohs 2007-11-10 08:24 PM

Amost there...
 
[QUOTE=haraldmartin;24306]Sorry, forgot to add this to the installation instruktions. You'll need to install to gems to make work, just do this in the Terminal (Applications → Utilities → Terminal):

sudo gem install markaby
sudo gem install appscript

Ciao[/QUOTE]

One last question. The first install worked fine. It asked me if I wanted to install dependencies and I said yes.

When installing the 'appscript' I get the following error:

ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find appscript (> 0) in any repository

Any advice is welcomed. I am so eager to try this! :) Thanks.

haraldmartin 2007-11-12 12:46 AM

Sorry, the second gem to install should be "rb-appscript" so type:

sudo gem install rb-appscript

and it will work. Thanks granin :)

Tinchohs 2007-11-12 05:18 PM

Not quite there yet ;)
 
[QUOTE=haraldmartin;24466]Sorry, the second gem to install should be "rb-appscript" so type:

sudo gem install rb-appscript

and it will work. Thanks granin :)[/QUOTE]

Harald, thanks for the help. It seems that it did install and then got an error. Does this message ring a bell?

Need to update 38 gems from [url]http://gems.rubyforge.org[/url]
......................................
complete
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0/gem_make.out


Thanks SO much.

haraldmartin 2007-11-12 10:39 PM

I think you have to have Apple's Developer Tools installed. They're free on your OS X install disk and/or downloadable from [URL="http://developer.apple.com/"]developer.apple.com[/URL]

Ciao
Martin

Richard Flynn 2007-11-13 06:05 AM

This is really exciting: thanks for your hard work, [B]haraldmartin[/B]. However I'm coming up with the following error message when I run the Sync OmniFocus with Safari.app:

[CODE]sh: /Applications/OmniFocus: No such file or directory [Edit] [OK][/CODE]

Clicking OK dismisses the dialog box and quits the application. Clicking Edit opens the AppleScript in Script Editor.

I am using Leopard. I have installed the Ruby Gems. I have the Developer Tools installed. I am using a non-administrator account. I haven't got any other data bookmarks in Safari.

OmniFocus is stored at /Applications/OmniFocus on my machine (so there [b]is[/b] such a file or directory!).

The background: the first time I ran the script, it evidently did something but didn't complete (I never got a confirmation dialog; the Sync .app just quit after a fairly short while). When I went to my bookmark in Safari, I saw that data had been added to the URL field, but opening it revealed a white page: the same result when viewed on MobileSafari. Viewing the source of the 'blank page' revealed that the script had evidently put in some of the necessary CSS into the <head> section but nothing else:
[INDENT]I was going to post everything that was included in the source code here, but it seems that there is a 10,000-character limit on Forum posts (fair enough), and posting everything just pushed my message over the limit to 10,433 characters. Effectively, the script has managed to generate Base64 data which translates as far as ".proje" (it cuts out in the middle of the word!) in the source of the viewed bookmark.
[/INDENT]
Meanwhile, I saw that I had a number of archived builds of OmniFocus sitting in my /Applications/ folder, left there by the Automatic Updater. I moved those to the Trash—after doing this I tried running the Sync .app again, but that resulted in the error message I quoted at the beginning of this post. I quit and restarted OmniFocus, and then logged out and logged in again, but neither of these had any effect—always the same error message.

Sorry that this is such a long post but I would rather be thorough: this script package looks like it would be super-useful for me so I'm keen to get it working! Thanks again for your efforts.

haraldmartin 2007-11-13 07:18 AM

Hi

I tried my scripts on a brand new, non-admin User Account (in Leopard) and I also have problems running them. I fixed some of the problems but I need some more time/work to make it a bit more solid.
I really want to wrap these scripts into an easier to use .app or something but right now I don't have very much time.

One solution would be to port the whole thing over to plain AppleScript. Then it wouldn't require DevTools or any gems installed and if I make it 10.5 only, I could change Safari's bookmarks.plist file using AppleScript (new in 10.5)

Let me work a bit more on this and I get back. If you have any suggestions, please let me know.

haraldmartin 2007-11-13 01:23 PM

OFfline v. 0.2
 
I just uploaded a new version (0.2) for you to test. The new version works for me on a new, non-admin user account so I think I worked around some of the bugs in the earlier version.
I also made the text-to-data encoding in the script itself so no need for the external FileMarkmaker-script which should work better since we don't need to create any temporary files. (the encoding was actually reduced to only 2 lines in ruby :)

Please try the new version. If the .app doesn't work for you, try running the ruby script directly from Terminal:

[FONT="Courier New"]cd path/to/OFfline && ruby OFfline.rb[/FONT]

[URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]Get the updated version here.[/URL]
Please send me any bugs and look into them.

Martin

Richard Flynn 2007-11-13 03:19 PM

Wow, thanks Martin for your very quick response! I've now got it working… sort of. Not everything is being synchronized. Some contexts which have got available tasks in are just showing up as the context name in the bookmark, with no tasks listed underneath… Thanks again for your help so far, though. I need to go to bed now, but will be sure to play with this considerably more in the morning. Here’s hoping that the promised SDK for the iPhone/iPod touch will provide frameworks for data to be synchronized between desktop and new native mobile applications…

haraldmartin 2007-11-13 11:01 PM

Can you send me your context-structure and what contexts that aren't syncronized? I think the problems are related to nested contexts and since my contexts work fine I think I need yours for testing. If you can provide me with a sample OF-document that is not working, it would be great for testing.

Currently the script is limited to only two levels of contexts (e.g. Mac and Mac → Code works) but Mac → Code → Ruby won't sync. I'll take a look at it asap.

Richard Flynn 2007-11-14 08:20 AM

Martin, thanks for your ongoing help.

You’re quite right: the contexts which aren’t syncing are those which are nested three-deep. I’ve just emailed you a sample database file for you to test with, as you asked.

haraldmartin 2007-11-14 08:22 AM

v0.3
 
Hello, just uploaded a new version with some changes including
[LIST][*]Support for unlimited leves of contexts[*]Fixed that parent contexts without any "own" tasks no longer appear[*]Made groups togglable by clicking them[/LIST]
Do you think tasks should be hidden by default so you click the group header to show them? Right now all tasks are visible.

[URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]Get it at the usual location[/URL]

Richard Flynn 2007-11-14 09:07 AM

Thanks for the update (and for your email), Martin. It’s now working great on my system (I had a problem at first, but quitting and restarting OF fixed that), including with the deep-nested contexts.

It doesn't currently bother me too much, but I could imagine it being useful having all the contexts collapsed when you first view the page. I do really like the ability to expand/collapse contexts as needed though, really good work!

haraldmartin 2007-11-14 10:55 AM

[QUOTE=Richard Flynn;24662]Thanks for the update (and for your email), Martin). It’s now working great on my system (I had a problem at first, but quitting and restarting OF fixed that), including with the deep-nested contexts.

It doesn't currently bother me too much, but I could imagine it being useful having all the contexts collapsed when you first view the page. I do really like the ability to expand/collapse contexts as needed though, really good work![/QUOTE]

Glad to hear that Richard.
You might want to update again (same url as before). I updated the script to have all tasks hidden by default. I think that's the right way to go.

granin 2007-11-14 09:58 PM

Hello Martin! Your script initially worked fine but then it started to give this error (see screenshot) I have almost all content in Russian in OF so I suppose that there is some owerflow in regExp due to conversion of Unicode to ASCII, let me know if I can help you in any way to fix this bug.

[IMG]http://lh3.google.com/granin/Rzvtu4FUBcI/AAAAAAAABv0/um0oCywTb3I/ofilne.png?imgmax=512[/IMG]

PS I just downloaded latest version (on screenshot)

haraldmartin 2007-11-15 02:28 AM

[QUOTE=granin;24701]Hello Martin! Your script initially worked fine but then it started to give this error (see screenshot) I have almost all content in Russian in OF so I suppose that there is some owerflow in regExp due to conversion of Unicode to ASCII, let me know if I can help you in any way to fix this bug.[/QUOTE]

Looks like the new output is too big for Ruby to handle right now. I haven't got this error myself yet. Do you have a large number of tasks to be synced?

Is it possible for you to e-mail me a sample document that trigger the error and I can try to debug the script. I have some ideas how to fix it (by replacing the RegExp with a plain dumber search).

haraldmartin 2007-11-15 02:22 PM

granin: I emailed you a new version that should (hopefully) fix the regexp-bug. Let me know here or by email if it works so I can post the new version (with some nice UI updates) for others as well.

MacSparky 2007-11-17 08:35 AM

I"m having an odd problem in terminal. When I input the commands, it asks for my password but wont let me type in terminal. Am I missing something obvious?

D

bernietheone 2007-11-17 04:38 PM

Hi!

This is just AWESOME! I installed the Version from haraldmartin from the first Page of this thread and it worked! Im running leopard with developer tools and only have installed appscript and markaby and it just worked!

Thanks and keep up the good work, for me its one good start into ruby...

bernie

jet14 2007-11-18 03:13 PM

1 Attachment(s)
I'm also having difficulty getting OFfline to work, on Leopard, with Xcode installed, etc.

The glitch I get is in the attached screenshot.

Thanks,

J

haraldmartin 2007-11-18 03:38 PM

Hello,

just uploaded a new version that fixed some bugs find by people here on the forum (thanks granin). The solution right now is not as nice and elegant as before but works and I guess that's more important. :)

I also embedded some of the iUI-background images directly in the stylesheet wich makes the output a bit nicer.

@MacSparky: the commands starting with "sudo" are supposed to ask for your password. sudo = SuperUser DO since you have to have access to system files to install the gems and developer tools.

@bernietheone: Thanks!

@jet14: Is your OmniFocus.app located in /Applications? Is it possible to e-mail me a sample document that triggers the bug? martin (at) burnfield (dot) com

jet14 2007-11-18 04:35 PM

[QUOTE=haraldmartin;25045]@jet14: Is your OmniFocus.app located in /Applications? [/QUOTE]

Yes.

[QUOTE=haraldmartin;25045]Is it possible to e-mail me a sample document that triggers the bug? martin (at) burnfield (dot) com[/QUOTE]

Sent. As I said in that message, it does seem to be something about my DB, as the script ran fine when I dumped my DB and just loaded the "sample" info OF starts with.

Thanks again,

J

CdtDelta 2007-11-18 08:29 PM

Well I'm trying to get the script to work and I'm pulling an error with this section of code in OFfline.rb:

li.task :style => 'display: none;' do |l|

(it's line 36 in the script)
I ran it through Komodo and it's showing a syntax error and the next line gives me an error of "useless use of | in void context" (again Komodo is reporting this).
The ruby gems installed fine. I'm assuming the OFfline folder doesn't need to be in a particular location (I just got the new updates of OmniFocus tonight).
I'm running 10.4.11 and OmniFocus 46.0.94800.

Thanks....

haraldmartin 2007-11-19 12:36 AM

@Jet: as I said in the email; there's a new version uploaded that works with your db so update your script to the latest version.

[URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip[/URL]

haraldmartin 2007-11-19 12:40 AM

[QUOTE=CdtDelta;25082]Well I'm trying to get the script to work and I'm pulling an error with this section of code in OFfline.rb:

li.task :style => 'display: none;' do |l|

(it's line 36 in the script)
I ran it through Komodo and it's showing a syntax error and the next line gives me an error of "useless use of | in void context" (again Komodo is reporting this).
Thanks....[/QUOTE]

If you're running Tiger and haven't upgraded your local copy of Ruby there might be a problem with this style. What version of Ruby are you running? Just type this into Terminal.app:

[FONT="Courier New"]ruby -v[/FONT]

Can you try and change the line causing the error to

[FONT="Courier New"]li.task(:style => 'display: none;') do |l|[/FONT]

and let me know if it works?

CdtDelta 2007-11-19 02:50 PM

Well I did a port install ruby to get me up to date (I also updated rubygems just in case). So here's what I'm running now:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]

I made the change in the line and that seemed to make Komodo's error checking happy.
However now the error I'm getting is:

OFfline.rb:17:in 'require': No such file to load -- rubygems
(LoadError)

Which I suspect means it doesn't see my rubygems install?

haraldmartin 2007-11-19 03:01 PM

[QUOTE=CdtDelta;25220]Well I did a port install ruby to get me up to date (I also updated rubygems just in case). So here's what I'm running now:

ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]

I made the change in the line and that seemed to make Komodo's error checking happy.
However now the error I'm getting is:

OFfline.rb:17:in 'require': No such file to load -- rubygems
(LoadError)

Which I suspect means it doesn't see my rubygems install?[/QUOTE]

Did you symlink /usr/bin/ruby to the new, updated version (in /opt/local if you installed via mac ports)?

try this:
which version?
[FONT="Courier New"]/usr/bin/ruby -v
/opt/local/bin/ruby -v[/FONT]

If the version living in /usr isn't the newest but the version built into Tiger (1.8.2 I believe) you should be able to fix this by linking the version in /usr/bin to the mac ports version:

[FONT="Courier New"]sudo mv /usr/bin/ruby /usr/bin/ruby~
sudo ln -nfs /opt/local/bin/ruby /usr/bin/ruby[/FONT]

This should fix Rubygems as well if you installed them via Mac Ports.

You can try to run the from the ruby living in /opt:
[FONT="Courier New"]/opt/local/bin/ruby ~/Desktop/OFfline/OFfline.rb[/FONT]

(change to match your real path of course). Does it work?

Please backup everything before etc so nothing is damaged.

CdtDelta 2007-11-19 07:51 PM

Well I checked the version of Ruby again and you were right, it moved. So I linked it like you said and ran the command line version you gave and got this output:

/Users/username/Downloads/OFfline/OFfline.rb:36: warning: don't put space before argument parentheses
/opt/local/lib/ruby/gems/1.8/gems/rb-appscript-0.4.0/lib/appscript.rb:505:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: 1
MESSAGE: NSReceiverEvaluationScriptError: 3 (The object or objects specified by the direct parameter to a command could not be found.)
COMMAND: app("/Applications/OmniFocus.app").documents.ID("lwsmxzYTdmG").projects.ID("k2Yu0hmELKd").root_task.parent_task.name.get()
from /opt/local/lib/ruby/gems/1.8/gems/rb-appscript-0.4.0/lib/appscript.rb:585:in `method_missing'
from /Users/username/Downloads/OFfline/OFfline.rb:22:in `markup_for_task'
from /Users/username/Downloads/OFfline/OFfline.rb:40:in `each_context'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `instance_eval'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:123:in `capture'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:155:in `tag!'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:211:in `html_tag'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/cssproxy.rb:43:in `call'
... 26 levels...
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:155:in `tag!'
from /opt/local/lib/ruby/gems/1.8/gems/markaby-0.5/lib/markaby/builder.rb:217:in `html_tag'
from (eval):3:in `html'
from /Users/username/Downloads/OFfline/OFfline.rb:71

haraldmartin 2007-11-20 04:00 AM

Looks like a bug I fixed yesterday. Have you downloaded the latest version? [URL="http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip"]http://burnfield.com/martin/wordpress/wp-content/uploads/OFfline.zip[/URL]

CdtDelta 2007-11-20 05:30 AM

No, sorry I didn't realize you had updated it.

Ok, so I got the new version and ran the sync without errors. But now I have a little weird issue. I use 1Password on my machine, and sync that with my iPhone. It looks like your script is overwriting that entry in my Safari bookmarks (they both have an address that starts with data:text/html). I can get it back by syncing 1Password again, so it's just a FIFO sort of thing. Is there any way to seperate two bookmarks that use the same data:text/html URL?

haraldmartin 2007-11-20 12:42 PM

[QUOTE=CdtDelta;25302]No, sorry I didn't realize you had updated it.

Ok, so I got the new version and ran the sync without errors. But now I have a little weird issue. I use 1Password on my machine, and sync that with my iPhone. It looks like your script is overwriting that entry in my Safari bookmarks (they both have an address that starts with data:text/html). I can get it back by syncing 1Password again, so it's just a FIFO sort of thing. Is there any way to seperate two bookmarks that use the same data:text/html URL?[/QUOTE]

Right now: no.
My script will take the first url starting with 'data:text/html' and replace it with the OF export. Not a perfect solution I know and I think I'll replace it with something that checks the bookmark's name as well so it can support multiple data-bookmarks (like 1password's)

Teall 2007-11-21 04:47 AM

When I run rb-appscript in terminal I get the following error:

Last login: Tue Nov 20 10:47:36 on ttys000
TeallMac:~ teall$ sudo gem install rb-appscript
Password:
Need to update 13 gems from [url]http://gems.rubyforge.org[/url]
.............
complete
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0/gem_make.out

haraldmartin 2007-11-21 05:56 AM

[QUOTE=Teall;25499]When I run rb-appscript in terminal I get the following error:

Last login: Tue Nov 20 10:47:36 on ttys000
TeallMac:~ teall$ sudo gem install rb-appscript
Password:
Need to update 13 gems from [url]http://gems.rubyforge.org[/url]
.............
complete
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0/gem_make.out[/QUOTE]

Have you installed Apple Developer Tools?

Teall 2007-11-22 04:51 PM

Yes, I installed Developer Tools from my Leopard DVD.

scot 2007-11-23 05:24 AM

Another quick idea
 
Everyone can sync their address books,
Here's a quick idea...

An applescript that makes a contact with the name Omni Focus.
Then, in the notes of that contact make a list of all the tasks categorized by context with "o"s for bullets. Like this

BEING A CONSUMER
o eat hamburger
o buy a mall
o eat hotdog

then, when you're out and about, you can ex them off like so...

BEING A CONSUMER
o eat hamburger
x buy a mall
o eat hotdog

When you sync your address book and run the applescript again, it checks for "x"s at the beginning of lines and checks them off in OF. if it sees new "o"s it puts them in the inbox

That would take no extra stuff besides the script and it would work pretty simply

Wild Rye 2007-11-23 08:56 PM

Or what about having the contact name = context? You could have a v-card for every context.

One nice benefit would be that this would be a start toward integrating to-do functions with contacts.

gordoncww 2007-11-25 04:58 PM

Ruby path
 
A quick note on ruby paths. If, like me, you use macports for ruby, then you'll need to change the first line of OFfline.rb from "#!/usr/bin/env ruby" to something like "#!/opt/local/bin/ruby" or whatever your ruby path is. From the terminal, type "which ruby" to find the correct path.

Thanks for making this great script.

haraldmartin 2007-11-25 11:58 PM

Actually, I was using macports as well on Tiger but I've symlinked my/usr/bin/ruby to the macport version in /opt so all my scripts would use the macports version. Then the shebang line should work since env ruby would point to your macports version.

Anyway, if it doesn't work then `which ruby` will help you find where your ruby is.

akrishna3 2007-11-27 06:03 PM

Safari URL in an email instead of bokmark
 
Instead of creating a bookmark from OF, is it possible to send the link as an email to myself? I sync my iPhone with a different computer and do not have .mac to sync my bookmarks. If the link can be sent to an email account, I can access it on the iPhone from the mail text.

Thanks for a great tool.

haraldmartin 2007-11-28 12:43 AM

I'm in the middle of some other work but it wouldn't bee too hard to embed the link into an email if you'd like to give it a try

Tinchohs 2007-12-07 07:56 AM

Martin, I am finally downloading the Developer Tools to see if I can make it work. I am fainlly in production mode with OF, so it's about time.

Do I need all the tools intalled? Is there a way around it? I ask because it's quite a bit of data and I have some constraints with space right now.

Thanks a lot. Martin.

haraldmartin 2007-12-07 08:51 AM

[QUOTE=Tinchohs;27885]Martin, I am finally downloading the Developer Tools to see if I can make it work. I am fainlly in production mode with OF, so it's about time.

Do I need all the tools intalled? Is there a way around it? I ask because it's quite a bit of data and I have some constraints with space right now.

Thanks a lot. Martin.[/QUOTE]

If you're on Leopard then the Developer Tools (I think you need the standard install but you can skip the documentation if you're low on space) should be enough (together with the ruby gems)

You just need the dev tools to compile the Appscript-gem used in the script actually, you don't need the dev tools (afaik) to actually run the script. So you might be able to uninstall the dev tools after you have installed the gems. But I'm not really sure.

Tinchohs 2007-12-07 08:57 AM

I will give it a try to uninstall afterwards. Thanks.

Tinchohs 2007-12-07 03:07 PM

Finally it works... This is awesome. Way too cool! This - to me - it increases the value of OF 100 fold. Thanks Martin. It's really cool app.

BTW, which is the criteria that defines which to dos get synched?

Thanks again!

haraldmartin 2007-12-09 03:51 PM

thanks, glad you like it!
It will sync all available tasks from every context (which have any tasks).

Ciao

javito 2007-12-12 03:45 PM

Hello all, when I tried to run sudo gem install markaby I get this error
developer tools installed and rubygems installed using macports, any idea? Many thanks

/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- sources (LoadError)
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/source_info_cache.rb:6
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/remote_installer.rb:12
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems.rb:112:in `manage_gems'
from /opt/local/bin/gem:10

manung 2007-12-28 08:21 PM

haraldmartin,

Thanks for the cool script, this is exactly what I needed except for one small thing. I often clip URLs so they appear as links under a Task's Note.

Unfortunately your script doesn't create hyperlinks for URLs in Notes, so I decided to hack up your script to do just that.

The modified rb file is here: [URL="http://www.hantech.org/files/OFfline.rb"]OFfline.rb[/URL]

Note for anyone who wants to use this, you need to replace the original OFfline.rb file from haraldmartin's package with this one.

haraldmartin 2007-12-28 11:05 PM

[QUOTE=manung;29852]haraldmartin,

Thanks for the cool script, this is exactly what I needed except for one small thing. I often clip URLs so they appear as links under a Task's Note.

Unfortunately your script doesn't create hyperlinks for URLs in Notes, so I decided to hack up your script to do just that.

The modified rb file is here: [URL="http://www.hantech.org/files/OFfline.rb"]OFfline.rb[/URL]

Note for anyone who wants to use this, you need to replace the original OFfline.rb file from haraldmartin's package with this one.[/QUOTE]

Great!
I've updated my version to include your fix. Many thanks!

kestorr 2007-12-29 06:23 AM

[QUOTE=haraldmartin;24546]I think you have to have Apple's Developer Tools installed. They're free on your OS X install disk and/or downloadable from [URL="http://developer.apple.com/"]developer.apple.com[/URL]

Ciao
Martin[/QUOTE]
Hi martin, I'm running Leopard and installed Xcode Tools via my install CD. More specifically chosen Optional Installs/Xcode Tools.mpkg and selected standard install. I still faced the below error when installing the second gem. Any insights into this? Your help will be greatly appreciated.

ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/rb-appscript-0.4.0/gem_make.out

billdill 2008-01-01 11:53 PM

[QUOTE=haraldmartin;25228]Did you symlink /usr/bin/ruby to the new, updated version (in /opt/local if you installed via mac ports)?

try this:
which version?
[FONT="Courier New"]/usr/bin/ruby -v
/opt/local/bin/ruby -v[/FONT]

If the version living in /usr isn't the newest but the version built into Tiger (1.8.2 I believe) you should be able to fix this by linking the version in /usr/bin to the mac ports version:

[FONT="Courier New"]sudo mv /usr/bin/ruby /usr/bin/ruby~
sudo ln -nfs /opt/local/bin/ruby /usr/bin/ruby[/FONT]

This should fix Rubygems as well if you installed them via Mac Ports.

You can try to run the from the ruby living in /opt:
[FONT="Courier New"]/opt/local/bin/ruby ~/Desktop/OFfline/OFfline.rb[/FONT]

(change to match your real path of course). Does it work?

Please backup everything before etc so nothing is damaged.[/QUOTE]

I may have ruined my ruby installation. In terminal I ran the command:

Ruby -v

and it returned a version number. But it still would not install the applescript Gem.

Then, as suggested above I ran the commands:

sudo mv /usr/bin/ruby /usr/bin/ruby~
sudo ln -nfs /opt/local/bin/ruby /usr/bin/ruby

Now when I run the version command I get:

ruby: command not found.

I'm a complete novice at this kind of hacking. Can anyone please help restore my ruby install? I already have the developer tools installed.

Thank you in advance for your help.

haraldmartin 2008-01-02 01:20 AM

[QUOTE=billdill;30040]I may have ruined my ruby installation. In terminal I ran the command:

Ruby -v

and it returned a version number. But it still would not install the applescript Gem.

Then, as suggested above I ran the commands:

sudo mv /usr/bin/ruby /usr/bin/ruby~
sudo ln -nfs /opt/local/bin/ruby /usr/bin/ruby

Now when I run the version command I get:

ruby: command not found.

I'm a complete novice at this kind of hacking. Can anyone please help restore my ruby install? I already have the developer tools installed.

Thank you in advance for your help.[/QUOTE]

The command will only work if you installed ruby using MacPorts. If you're on Tiger you need to do this (update your Ruby installation, there are planty of guides how to do it, just google it). To make your ruby work again, just rename your backup copy back:

sudo mv /usr/bin/ruby~ /usr/bin/ruby

and it should work again.

billdill 2008-01-05 04:31 AM

Thank you for your assistance. I'm sorry that I wasn't more specific. I'm using Leopard.

I tried the command and I got the message:

mv: rename /usr/bin/ruby~ to /usr/bin/ruby: No such file or directory

The odd thing, when I drill down and type the ls command in the /usr/bin directory I can see ruby listed there. I don't understand that.

Thanks for your help,

bd

Gretchen 2008-01-05 09:13 PM

Whoo ha! Thank you!
 
Thank you Martin! With much trepidation, since I really don't know what I'm doing in terminal but have been very frustrated not being able to access OF on the iPhone, I installed the Xcode, ran the sudo commands, didn't blow up anything, ran your script, and there it is! Lovely magic.

ciao,
Gretchen

euchomai 2008-01-20 06:55 AM

Okay, I finally got this working!

Am I correct to say that if a project is sequential the script will not pull any task beyond the "next action"? That is the way it is working on my machine at least.

Why would you not want all the tasks for a sequential project on your iPhone when you are on the go? I need the entire project listed sequentially!

Do I have something working oddly with my script?
Is there a "quick fix" to have the script pull all tasks instead of the first sequential task?

Thanks geniuses!


All times are GMT -8. The time now is 06:46 PM.

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