ttscoff / hookapp

MIT License
89 stars 4 forks source link

execution error: The variable bookmark is not defined. #8

Closed Tokubara closed 2 years ago

Tokubara commented 2 years ago

This is the first command I executed since I installed hookapp.

hook clip  /Users/quebec/Downloads/logins.csv

The error message is:

60:68: execution error: The variable bookmark is not defined. (-2753)
error: Error getting bookmark for /Users/quebec/Downloads/logins.csv
ttscoff commented 2 years ago

That appears to be an AppleScript error indicating something went wrong on the hook side. I just tested the command locally and all appears to be fine. Did you test the same command on other files and have the same result?

Tokubara commented 2 years ago

Yes, every file path just gives the same result.

$ gem --version      
3.0.3
$ ruby --version                    
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

My os version is 10.15.7(Catalina).

Tokubara commented 2 years ago

Other commands do not work, too.

$ hook find asc
90:98: syntax error: Expected class name but found identifier. (-2741)
90:98: syntax error: Expected class name but found identifier. (-2741)
No bookmarks

But I do have a hook with "asc" in name.

Tokubara commented 2 years ago

I suspect it's due to that Hook changes its name to HookMark (in October), so macos cannot find the application?

ttscoff commented 2 years ago

At least for the time being Hookmark still responds to application "Hook" so that's not the issue. I'd be curious what happens if you open Script Editor and ran the following:

set searchString to "asc"
      tell application "Hook"
        set _marks to every bookmark whose name contains searchString
        set _out to {}
        repeat with _hook in _marks
          set _out to _out & (name of _hook & "||" & address of _hook & "||" & path of _hook)
        end repeat
        set {astid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "^^"}
        set _output to _out as string
        set AppleScript's text item delimiters to astid
        return _output
      end tell

Does that give you an error as well?

Tokubara commented 2 years ago

It asks me: What is Hook? So I still think it is due to the name of the application.

image

And if I change "Hook" to "HookMark", it works:

"2.asc||hook://file/Jz5uzbeAX?p=RG93bmxvYWRzL3RzbWNfMTgwX25t&n=2%2Easc||/Users/quebec/Downloads/tsmc_180_nm/2.asc"
ttscoff commented 2 years ago

Interesting. I'm running the latest Hookmark and if I change Hook to Hookmark, script editor changes it right back. And all of the commands execute properly for me. I'll have to look into why that is.

ttscoff commented 2 years ago

I just pushed v1.2.0 with all references to Hook updated to Hookmark. Seems to work fine on my machine, please use gem upgrade hookapp and let me know if it works for you.

Tokubara commented 2 years ago

Thank you, it works!