Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Open a non-QS file with associated program vs. import/convert to QS-file

79 views
Skip to first unread message

QSinLG

unread,
Jul 24, 2009, 6:07:16 AM7/24/09
to
How to make QS open a file with the program which is associated (on
operating system level) with the file extension (e.g. xls) instead of
import/convert to QS?
[QS 2, Windows XP Professional]

Thx

Udo Roskothen

unread,
Aug 7, 2009, 5:47:57 AM8/7/09
to

"QSinLG" <stefan.r...@de.nordson.com> schrieb im Newsbeitrag
news:3a63b44b-aed8-4c42...@o6g2000yqj.googlegroups.com...

for pdf have a look at:
tools->filters->filters..
maybe you will find a way

we use a lisp as workaround, i drop it down here
sorry, not all comments in english
use at your own risk

-----start---------
;;
;; Opens selected file with defined program
;;
;; Programm Name: open_with_
;;
;; Gebrauch/usage
;;
;; Lisp im System6->Anpassen->Ausgew锟絟lt Schrank einf锟絞en.
;; place in System6->custom->Selection
;;
;; Version 0 02.03.2004 Udo Roskothen
;; Version 1 02.12.2005 pfade angepasst auf office11 und windows
Verzeichnisse
;; Version 2 14.11.2006 nichts ausgew锟絟lt Stickup


(lisp-set-implementation "Interleaf Lisp" "2.0")


;=======================================================
; Abbruch, wenn nichts ausgew锟絟lt
;=======================================================
(unless (dt-children-selected (dt-pointer-container))
(stk-open "Nichts ausgewaehlt!.")
(abort-lisp-load))

;=============================================
;; Definitions:
;=============================================
;;Name of program, must be absolute if not to be find in path variable (DOS)
;;no error handling, if program does not exist!

;; Windows Verzeichnis pr锟絝en
(SETQ *win_dir* NIL)
(SETQ *win_dir* (probe-file "C:\\windows\\." ))
(WHEN (NOT *win_dir*)
(SETQ *win_dir* (probe-file "C:\\win_nt\\." )))
(WHEN (NOT *win_dir*)
(STK-open (CONCAT "Windows Verzeichnis nicht gefunden in c:\\windows oder
c:\\win_nt. Programm abgebrochen"))
;(abort-lisp-load)
)


;; Office Verzeichnis pr锟絝en
(SETQ *office_dir* NIL)
(SETQ *office_dir* (probe-file "C:\\Programme\\Microsoft
Office\\OFFICE11\\." ))
(WHEN (NOT *office_dir*)
(SETQ *office_dir* (probe-file "C:\\Programme\\Microsoft
Office\\OFFICE\\." )))
(WHEN (NOT *office_dir*)
(STK-open (CONCAT "Office Verzeichnis nicht gefunden in Programme\\office
oder Office11. Programm abgebrochen"))
;(abort-lisp-load)
)


(setq selected_filename (file-resolve-link (dt-path (dt-child-selected))) )


;default openening method:
(setq program-name "c:\\Programme\\Windows NT\\Zubeh\xF6\r\\wordpad.exe")
;(setq program-name (CONCAT *office_dir* "\\winword.exe"))
;(setq program-name (CONCAT *office_dir* "\\powerpnt.exe"))
;(setq program-name (CONCAT *office_dir* "\\Excel.exe"))
;(setq program-name "M:\\Siempelkamp-doc\\bin\\TecView\\tecview.exe")
;(setq program-name "")

;=============================================
;; check if ext is at end of str
;=============================================
;(defun string-contained-extension (ext str) :boolean false
; (if (string= ext (substring str ( - (length ext))) ) t ) )
; not error-free? dont know....

;=============================================
;; my settings
;=============================================
;open with wordpad
;(if (string= ".lsp" (substring selected_filename ( - (length
".lsp"))) )(setq program-name "c:\\Programme\\Windows
NT\\Zubeh锟絩\\wordpad.exe") )

;open with Excel
(if (string= ".xls" (substring selected_filename ( - (length ".xls"))) )
(setq program-name (CONCAT *office_dir* "\\Excel.exe")) )
(if (string= ".xlw" (substring selected_filename ( - (length ".xlw"))) )
(setq program-name (CONCAT *office_dir* "\\Excel.exe")) )
(if (string= ".cvs" (substring selected_filename ( - (length ".cvs"))) )
(setq program-name (CONCAT *office_dir* "\\Excel.exe")) )

;open with Word
(if (string= ".doc" (substring selected_filename ( - (length ".doc"))) )
(setq program-name (CONCAT *office_dir* "\\winword.exe")) )
(if (string= ".rtf" (substring selected_filename ( - (length ".rtf"))) )
(setq program-name (CONCAT *office_dir* "\\winword.exe")) )

;open with powerpoint
(if (string= ".ppt" (substring selected_filename ( - (length ".ppt"))) )
(setq program-name (CONCAT *office_dir* "\\powerpnt.exe")) )
(if (string= ".pps" (substring selected_filename ( - (length ".pps"))) )
(setq program-name (CONCAT *office_dir* "\\powerpnt.exe")) )

;open with TecView
(if (string= ".tif" (substring selected_filename ( - (length ".tif"))) )
(setq program-name "M:\\Siempelkamp-doc\\bin\\TecView\\tecview.exe") )
(if (string= ".tiff" (substring selected_filename ( - (length ".tiff"))) )
(setq program-name "M:\\Siempelkamp-doc\\bin\\TecView\\tecview.exe") )


;open with explorer
(if (string= ".ilfdr" (substring selected_filename ( - (length ".ilfdr"))) )
(setq program-name (CONCAT *win_dir* "\\explorer.exe")) )
(if (string= ".ilboo" (substring selected_filename ( - (length ".ilboo"))) )
(setq program-name (CONCAT *win_dir* "\\explorer.exe")) )
(if (string= ".ildrw" (substring selected_filename ( - (length ".ildrw"))) )
(setq program-name (CONCAT *win_dir* "\\explorer.exe")) )
(if (string= ".ilcab" (substring selected_filename ( - (length ".ilcab"))) )
(setq program-name (CONCAT *win_dir* "\\explorer.exe")) )


;=============================================
;; check if program exist
;=============================================
(unless (probe-file program-name)
(stk-open (list "Program not found:\n\n~A\n\nABORT" program-name))
(abort-lisp-load))


;=============================================
;; creating new process
;=============================================
(setq proc (tell-class proc-class mid:new ))
;; setting process definition
(tell proc mid:set-props
:prog program-name
:args (list selected_filename ) )
;=============================================
;; starting procedure
;=============================================
(tell proc mid:start)

-----end---------


QSinLG

unread,
Aug 10, 2009, 3:31:41 AM8/10/09
to
Hello Udo,
with some customization, your script works fine for me, provided that
the file (e.g. "file.xls") is placed in a QS container (e.g. desktop).
When clicking a QS-HYPERLINK which points to "C:\archive\file.xls", QS
still starts converting/importing the file.
(But hyperlinking is an annoyance for some other reasons anyway ...)

Thanks

0 new messages