lib/hook/hookapp.rb
# Get a Hook bookmark for file or URL. Return bookmark hash.
Get a Hook bookmark for file or URL. Return bookmark hash.
Get a Hook bookmark for file or URL . Return bookmark hash .
def bookmark_for(url)
    url.valid_hook!
    raise "Invalid target: #{url}" unless url
    begin
      mark = `osascript <<'APPLESCRIPT'
        tell application "Hook"
          set _hook to make bookmark with data "#{url}"
          if _hook is missing value
            return ""
          else
            return name of _hook & "||" & address of _hook & "||" & path of _hook
          end if
        end tell
      APPLESCRIPT`.strip
    rescue p => e
      raise e
    end
    raise "Error getting bookmark for #{url}" if mark.empty?
    mark.split_hook
  end
def bookmark_for ( url ) url . valid_hook! raise "Invalid target: #{url}" unless url begin mark = ` osascript <<'APPLESCRIPT'
        tell application "Hook"
          set _hook to make bookmark with data " #{ url } "
          if _hook is missing value
            return ""
          else
            return name of _hook & "||" & address of _hook & "||" & path of _hook
          end if
        end tell
      APPLESCRIPT ` . strip rescue p => e raise e end raise "Error getting bookmark for #{url}" if mark . empty? mark . split_hook end
Get a Hook bookmark for file or URL.
Get a Hook bookmark for file or URL .
url
<not_specific>