How to use Form API #attached and module's own scripts with jQuery Multi module?
Solution seems to be to hack jQuery Multi module.

First, we want to add module-provided libraries to the list in configuration options. Function responsible for it is jqmulti_get_available_libraries():

/**
 * Returns available libraries to be used in the admin form.
 */
function jqmulti_get_available_libraries() {
  $libs = libraries_get_libraries();

  unset($libs['jquery']);
  foreach ($libs as $key =&gt; $value) {
    $libs[$key] = $key;
  }
  return $libs;
}


To display module-provided libraries, we need to add following line:

$libs += module_invoke_all('library');


Of course now it looks ugly:



List is long and hard to understand, because these are machine names only. Red colour used to distinguish element I added by hand after taking screenshot, it's all black folks.

Form element is defined in jqmulti.admin.inc, but it's the only place that ever uses jqmulti_get_available_libraries(), so we may stay inside it instead, to limit changes to narrow area. If we change this:

  foreach ($libs as $key =&gt; $value) {
    $libs[$key] = $key;
  }


to this:

foreach ($libs as $key =&gt; $value) {
  if(isset($value['title'])) {
    $libs[$key] = '&lt;strong&gt;' . $value['title'] . '&lt;/strong&gt; ' . @$value[version] . ' (' . $key . ')';
  } else {
    $libs[$key] = '&lt;strong&gt;' . $key . '&lt;/strong&gt; (' . $value . ')';
  }
}


output will get a lot more readable:



Again, blanked a project-related row but it is there all right.

But now the fun part begins. I can save, but logic is all wrong:


  
  Warning: scandir(sites/all/libraries/product_form): failed to open dir: No such file or directory in jqmulti_find_all_js_files() (line 180 of /var/www/sites/all/modules/jqmulti/jqmulti.module).
  Warning: scandir(): (errno 0): Success in jqmulti_find_all_js_files() (line 180 of /var/www/sites/all/modules/jqmulti/jqmulti.module).
  Warning: Invalid argument supplied for foreach() in jqmulti_find_all_js_files() (line 181 of /var/www/sites/all/modules/jqmulti/jqmulti.module).
  


Error is located in function jqmulti_find_all_js_files($dir) function. Obviously module still tries to use old way of scanning /sites/all/libraries even when I clicked a library that is not there. Function is called from jqmulti_get_library_files($library, $reset = FALSE) that blindly assume all files are in 'sites/all/libraries'. First, it's a bug in it's own right, second it's not sufficient. We need to change:

$base_path = 'sites/all/libraries';


to something smarter. For example:

if(isset($libraries_libraries[$library])) { // Give precedent to old way
  $path = $libraries_libraries[$library];
} elseif(isset($module_libraries[$library])) {
  $path = NULL;
  $files = array_keys($module_libraries[$library]['js']);
} else { // Fallback to the old way, for what it's worth
   $path = $base_path . '/' . $library;
}


As you can see, if module gave us files already, there is no need to play with $path, we may use it directly. So code below needs to be wrapped in if.

That's all, now it works. Without conflict with Views, but with all jQuery Multi's own issues, some especially urgent for me.