[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatizzare utilizzo di programma dotato di interfaccia grafica



gerlos writes:

 > > Vorrei un SW che tramite  una sequenza di istruzioni invochi gvim
 > > e dentro ci scrivi uno e poi selezioni il pulsante per salvare il
 > > file con il nome ed in cui si scrivi il nome uno.txt etc.

 > OK, chiaro. Ti serve qualcosa come AutoHotKey per Windows.  Prova
 > autokey: http://code.google.com/p/autokey/

<saccenza mode="on" extradata=":) :) :) :) :) :)">
No, gli serve:

:;exec emacs -batch -l   "$0" -f : "$@" --no-site-file -q  # -*- Emacs-Lisp -*-
;     @emacs -batch -l "%~f0" -f :  %*  --no-site-file -q  & goto :EOF
;
; This script will obfuscate a text file, by loading it in, then repeatedly
; doing pairs of ^F and ^T commands throughout, and then saving it.  The original
; file is kept as a tilde (~) backup.
;
; Usage:  script-name  text-file-name
;         To reverse the process and get your original file as a result,
;         run the script again.
;
; (No it will not fool any serious cryptographer/programmer, but it will keep folks
;  from reading over your shoulder (the results are -really- hard on the eyes) and
;  will probably keep your children from ever decoding it.)
;
(defun : ()
  (find-file (nth 5 command-line-args))
  (condition-case nil
      (execute-kbd-macro "\^f\^[1\^t" 0)
    (error nil) )
  (save-buffer) )
;:EOF

In alternativa sarebbe utile conoscere  Unix, dato che GNU/Linux è uno
Unix e gvim è vim con una  crostaccia X11 (vim ha il solo vantaggio di
partire in tempo  quasi 0) e vi(m)  ha da 30 anni  almeno una versione
adatta all'uso  negli script  chiamata sed  e che non  è altro  che la
versione su stream (file) di ed, di cui vi è la versione full screen.

Non che sia facile scrivere un  file per sed. Credo che quattro grammi
di Emacs Lisp siano molto più leggibili :)
</saccenza>

-- 
 /\           ___                                    Ubuntu: ancient
/___/\_|_|\_|__|___Gian Uberto Lauri_____               African word
  //--\| | \|  |   Integralista GNUslamico            meaning "I can
\/                 coltivatore diretto di software       not install
     già sistemista a tempo (altrui) perso...                Debian"

Warning: gnome-config-daemon considered more dangerous than GOTO


Reply to: