lib/hook/hookapp.rb
# Link 2 or more files/urls with bi-directional hooks.
Link 2 or more files/urls with bi-directional hooks.
Link 2 or more files / urls with bi - directional hooks .
def link_files(args)
    target = args.pop
    target.valid_hook!
    raise "Invalid target: #{target}" unless target
    args.each do |file|
      file.valid_hook!
      raise "Invalid target: #{file}" unless file
      puts "Linking #{file} and #{target}..."
      `osascript <<'APPLESCRIPT'
        tell application "Hook"
          set _mark1 to make bookmark with data "#{file}"
          set _mark2 to make bookmark with data "#{target}"
          hook _mark1 and _mark2
          return true
        end tell
      APPLESCRIPT`
    end
    "Linked #{args.length} files to #{target}"
  end
def link_files ( args ) target = args . pop target . valid_hook! raise "Invalid target: #{target}" unless target args . each do | file | file . valid_hook! raise "Invalid target: #{file}" unless file puts "Linking #{file} and #{target}..." ` osascript <<'APPLESCRIPT'
        tell application "Hook"
          set _mark1 to make bookmark with data " #{ file } "
          set _mark2 to make bookmark with data " #{ target } "
          hook _mark1 and _mark2
          return true
        end tell
      APPLESCRIPT ` end "Linked #{args.length} files to #{target}" end
Link 2 or more files/urls with bi-directional hooks.
Link 2 or more files / urls with bi - directional hooks .
args
<not_specific>