Not being able to run the script
daviddias opened this issue · 8 comments
Hi! First of all, thank you for making the script, it is exactly what I was looking for :)
I'm trying to get it to work, it seems that there might have been an update on the in some dep, the error is the following:
» ruby bin/githubomnifocus.rb
bin/githubomnifocus.rb:61:in `get_issues': undefined local variable or method `auth' for main:Object (NameError)
from bin/githubomnifocus.rb:124:in `add_github_issues_to_omnifocus'
from bin/githubomnifocus.rb:215:in `main'
from bin/githubomnifocus.rb:220:in `<main>'
I've 0 experience with ruby, does it look like a quick fix?
Ok, I believe I figured out the auth part by changing the line:
https://github.com/devondragon/github-omnifocus/blob/master/bin/githubomnifocus.rb#L61
to:
client = Octokit::Client.new(:access_token => $opts[:oauth])
Now I'm getting:
» ruby bin/githubomnifocus.rb
/usr/local/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:542:in `_send_command': CommandError(Appscript::CommandError)
OSERROR: -1728
MESSAGE: Can't get reference.
OFFENDING OBJECT: app("/Applications/OmniFocus.app").default_document.flattened_contexts[""]
COMMAND: app("/Applications/OmniFocus.app").default_document.flattened_tasks["GitHub Inbox"].make({:new=>:task, :with_properties=>{:name=>"js-libp2p-#86: [PR] [WIP] Awesome DHT", :context=>app("/Applications/OmniFocus.app").default_document.flattened_contexts[""], :note=>"https://github.com/libp2p/js-libp2p/issues/86\n\nWork tracker: https://github.com/libp2p/js-libp2p-dht/pull/1\r\n\r\n-[x] update API docs for peerRouting and contentRouting https://hackmd.io/JwVgTGDGAmLAtAIwCyQMz2QBnEr1F4B2LADhAEMBGANkmGRAFMg=?both", :flagged=>true}})
from /usr/local/lib/ruby/gems/2.3.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from bin/githubomnifocus.rb:115:in `add_task'
from bin/githubomnifocus.rb:152:in `block in add_github_issues_to_omnifocus'
from bin/githubomnifocus.rb:131:in `each'
from bin/githubomnifocus.rb:131:in `add_github_issues_to_omnifocus'
from bin/githubomnifocus.rb:215:in `main'
from bin/githubomnifocus.rb:220:in `<main>'
Looks like omnifocus changed its API?
I ended up hacking a quick solution with Node.js, thank you eitherway :)
If anyone is interested, you can find it here: https://github.com/diasdavid/github-to-omnifocus
I am using u/p not oauth, so that's probably why I haven't encountered this issue. Anyone using oauth with this and having it working?
Yeah, I just ran into this this too. It looks like the script got the data from github just fine, it is just having trouble with omnifocus. This script was working fine before. Perhaps it was an Omnifocus software update? It's very strange.
The Jira omnifocus script is getting the same error.
/Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -1728
MESSAGE: Can't get reference.
OFFENDING OBJECT: app("/Applications/OmniFocus.app").default_document.flattened_contexts["Computer:Work"]
COMMAND: app("/Applications/OmniFocus.app").default_document.flattened_contexts["Computer:Work"].tasks.get()
from /Library/Ruby/Gems/2.0.0/gems/rb-scpt-1.0.1/lib/rb-scpt.rb:642:in `method_missing'
from ./jiraomnifocus.rb:308:in `mark_resolved_jira_tickets_as_complete_in_omnifocus'
from ./jiraomnifocus.rb:423:in `main'
from ./jiraomnifocus.rb:430:in `<main>'
I've filed jira-omnifocus#38.
@darconeous the Node.js version has been working pretty well for me https://github.com/diasdavid/github-to-omnifocus let me know if it works for you too
It seems that OmniFocus wasn't liking the :
separator for describing nested contexts. Removing that and just using the last context name fixed the problem.
Did you specify a default context in your .ghofsync.yaml
file?