lib/hook/hookapp.rb
# Create bi-directional links between every file/url in the list of arguments
Create bi-directional links between every file/url in the list of arguments
Create bi - directional links between every file / url in the list of arguments
def link_all(args)
    args.each do |file|
      source = file.valid_hook
      link_to = args.dup.map(&:valid_hook).reject { |url| url == source }
      link_to.each do |url|
        `osascript <<'APPLESCRIPT'
          tell application "Hook"
            set _mark1 to make bookmark with data "#{source}"
            set _mark2 to make bookmark with data "#{url}"
            hook _mark1 and _mark2
            return true
          end tell
        APPLESCRIPT`
      end
    end
    "Linked #{args.length} files to each other"
  end
def link_all ( args ) args . each do | file | source = file . valid_hook link_to = args . dup . map ( & :valid_hook ) . reject { | url | url == source } link_to . each do | url | ` osascript <<'APPLESCRIPT'
          tell application "Hook"
            set _mark1 to make bookmark with data " #{ source } "
            set _mark2 to make bookmark with data " #{ url } "
            hook _mark1 and _mark2
            return true
          end tell
        APPLESCRIPT ` end end "Linked #{args.length} files to each other" end
Create bi-directional links between every file/url in the list of arguments
Create bi - directional links between every file / url in the list of arguments
args
<not_specific>