(declare-function dnd-open-file "dnd" (uri action))
+;; Handles multiline strings that are passed to the "open-file" service.
+(defun ns-open-file-service (filenames)
+ "Open multiple files when selecting a multiline string FILENAMES."
+ (let ((filelist (split-string filenames "[\n\r]+" t "[ \u00A0\t]+")))
+ ;; The path strings are trimmed for spaces, nbsp and tabs.
+ (dolist (filestring filelist)
+ (dnd-open-file filestring nil))))
+
+
(defun ns-spi-service-call ()
"Respond to a service request."
(interactive)
(switch-to-buffer (generate-new-buffer "*untitled*"))
(insert ns-input-spi-arg))
((string-equal ns-input-spi-name "open-file")
- (dnd-open-file ns-input-spi-arg nil))
+ (ns-open-file-service ns-input-spi-arg))
((string-equal ns-input-spi-name "mail-selection")
(compose-mail)
(rfc822-goto-eoh)