Open miklb opened 1 year ago
Hrm. That's going to be hard to track down. It indicates that it's not reading the xml file properly to begin with, but I'd have to be able to replicate the error to figure out exactly where the issue is.
What do you get if you open Terminal and run:
plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist
It outputs quite a bit of data as XML.
I attempted the action again and I get a new error
The action “Run Shell Script” encountered an error: “-e:1711: warning: found `= literal' in conditional, should be ==
-e:1485:in `get_safari_bookmarks': undefined method `[]' for nil:NilClass (NoMethodError)
This would be easier to debug on the command line. It works great for me, but that error your getting doesn't narrow down where the issue would be. Are you technically able to download the source and install the gem for testing?
I can add a debugging branch to the code if you're able to clone the repo and build the gem (or just run the compile script). Let me know and I'll provide directions.
-Brett
On 22 Jan 2023, at 19:40, Michael Bishop wrote:
It outputs quite a bit of data as XML.
I attempted the action again and I get a new error
The action “Run Shell Script” encountered an error: “-e:1711: warning: found `= literal' in conditional, should be == -e:1485:in `get_safari_bookmarks': undefined method `[]' for nil:NilClass (NoMethodError)
-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/searchlink/issues/3#issuecomment-1399680766 You are receiving this because you commented.
Message ID: @.***>
I made some changes to the Safari bookmarks search in an update this morning. I didn't change anything that I think would directly affect this issue, but do please test with the latest release.
-Brett
On 22 Jan 2023, at 19:40, Michael Bishop wrote:
It outputs quite a bit of data as XML.
I attempted the action again and I get a new error
The action “Run Shell Script” encountered an error: “-e:1711: warning: found `= literal' in conditional, should be == -e:1485:in `get_safari_bookmarks': undefined method `[]' for nil:NilClass (NoMethodError)
-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/searchlink/issues/3#issuecomment-1399680766 You are receiving this because you commented.
Message ID: @.***>
I tested the latest zip with similar results. I read the release notes on building the gem locally and nothing too daunting there so I'm happy to try and help with deeper debugging next chance I get.
Latest full error message
The action “Run Shell Script” encountered an error: “-e:2359:in `get_safari_bookmarks': undefined method `[]' for nil:NilClass (NoMethodError)
from -e:2303:in `search_safari_bookmarks'
from -e:2503:in `block in search_history'
from -e:2502:in `each'
from -e:2502:in `search_history'
from -e:2487:in `search'
from -e:1104:in `block (2 levels) in do_search'
from -e:69:in `block in search_with_timeout'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
from -e:68:in `search_with_timeout'
from -e:1105:in `block in do_search'
from -e:1102:in `each'
from -e:1102:in `do_search'
from -e:3389:in `do_search'
from -e:3921:in `block (2 levels) in parse'
from -e:3678:in `gsub!'
from -e:3678:in `block in parse'
from -e:3652:in `each'
from -e:3652:in `each_with_index'
from -e:3652:in `parse'
from -e:4432:in `<main>'”
I tried installing an updated version of Ruby (3.2.0) using Homebrew - rbenv
and ruby-build
but it seems the service defaults to using /System/Library/Frameworks/Ruby.framework/Versions/2.6/
regardless.
Do you mean the Automator version, or are you running it from the command line now? The automator version will always default to the system ruby.
-Brett
On 24 Jan 2023, at 21:57, Michael Bishop wrote:
I tried installing an updated version of Ruby (3.2.0) using Homebrew -
rbenv
andruby-build
but it seems the service defaults to using
/System/Library/Frameworks/Ruby.framework/Versions/2.6/
regardless.-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/searchlink/issues/3#issuecomment-1403062411 You are receiving this because you commented.
Message ID: @.***>
Oh, you did mean the service version. It's actually good that it uses a consistent ruby, makes my life easier :).
I tested the latest zip with similar results. I read the release notes on building the gem locally and nothing too daunting there so I'm happy to try and help with deeper debugging next chance I get.
Latest full error message
The action “Run Shell Script” encountered an error: “-e:2359:in `get_safari_bookmarks': undefined method `[]' for nil:NilClass (NoMethodError)
So I can prevent this error from being thrown, but the fact that the object is nil indicates it's not finding the bookmarks to begin with, or that the format is unexpected. It's working fine for me locally, but I literally only have one variation of the bookmarks file to examine. Try this version and see if you get at least a different error.
attempting to use On Trying (Safari history shows "On Trying | danksinker.com" with link to https://dansinker.com/posts/trying/ ) I receive this error
I can confirm I have a
.searchlink
file in my root user directory and includes the defaultDo I need to grant permission to the service for bookmarks/history? FWIW I'm running 13.2 Beta (22D5038i)