File: ApplyToSelection.scm

package info (click to toggle)
denemo 2.6.49-0.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 66,916 kB
  • sloc: ansic: 94,587; lisp: 38,713; xml: 22,675; python: 1,930; sh: 1,239; makefile: 642; yacc: 288; sed: 93
file content (21 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;;;ApplyToSelection
(let ((selection (d-GetSelection)))
(if selection
	(begin
		(d-PushPosition)
		(if (not DenemoKeypressActivatedCommand)
			(d-WarningDialog "Close this dialog, then press a shortcut key/shortcut keys to apply the command to every object in the selection\n\nThis command will execute the command you give once with the cursor on  each object in the selection. E.g. if you select 8 notes and give a shortcut for ZoomIn it will zoom 8 times."))
;;;after dialog (if any) dismissed:		
		(let (( var (d-GetCommandFromUser)))
			(MasterMute #t)
			(d-TakeSnapshot)
			(d-IncreaseGuard)
			(if var (ApplyToTaggedSelection  (eval-string (string-append "d-" var))))
			(d-DecreaseGuard)
			(apply d-GoToPosition (car selection))
			(d-SetMark)
			(apply d-GoToPosition (cdr selection))
			(d-SetPoint)
			(d-PopPosition)
			(MasterMute #f)))
	(d-WarningDialog (_ "No selection"))))