1 | #Please insert up references in the next lines (line starts with keyword UP) |
---|
2 | UP arb.hlp |
---|
3 | UP glossary.hlp |
---|
4 | |
---|
5 | #Please insert subtopic references (line starts with keyword SUB) |
---|
6 | #SUB subtopic.hlp |
---|
7 | |
---|
8 | # Hypertext links in helptext can be added like this: LINK{ref.hlp|http://add|bla@domain} |
---|
9 | |
---|
10 | #************* Title of helpfile !! and start of real helpfile ******** |
---|
11 | TITLE Macros |
---|
12 | |
---|
13 | OCCURRENCE ARB_NT |
---|
14 | |
---|
15 | DESCRIPTION Macros are used to combine a set of menu-actions. They work like |
---|
16 | a tape recorder, which records all buttons presses, every input |
---|
17 | to data fields, ... |
---|
18 | |
---|
19 | To record a new macro, go to the directory where the new macro |
---|
20 | should be placed, enter a macro name and press <RECORD>. The |
---|
21 | button label will switch to <STOP>. |
---|
22 | |
---|
23 | Now perform all actions you like to record, then press <STOP>. |
---|
24 | |
---|
25 | If you like to expand an existing macro, check the 'Expand?' toggle |
---|
26 | before pressing <RECORD>. You can also check the 'Run before?' toggle |
---|
27 | to execute the existing macro before expanding it. |
---|
28 | |
---|
29 | Press 'Interrupt' while recording, |
---|
30 | to plan a later interruption during playback. |
---|
31 | See LINK{macro_interruption.hlp} for details. |
---|
32 | |
---|
33 | To execute an existing macro, select the macro and press <EXECUTE>. |
---|
34 | |
---|
35 | Press <Execute with each marked species> to execute the selected macro |
---|
36 | multiple times: once for each marked species. |
---|
37 | |
---|
38 | * this loop is performed in database order (see LINK{sp_sort_fld.hlp}). |
---|
39 | * before each call of the macro, one species will be marked AND |
---|
40 | selected - all other species will be unmarked. |
---|
41 | * afterwards the original species marks will be restored. |
---|
42 | |
---|
43 | Press <EDIT> to edit the selected macro. |
---|
44 | |
---|
45 | Press <DELETE> to delete the selected macro. |
---|
46 | |
---|
47 | SECTION What gets recorded? |
---|
48 | |
---|
49 | The macro recorder only records elements like buttons, menues and |
---|
50 | values (like input fields, radio buttons, selection lists, toggles, ...). |
---|
51 | Actions in the main area (e.g. tree view) will not be recorded! |
---|
52 | |
---|
53 | Elements of a window are unknown to the macro playback if the window was not |
---|
54 | opened before. So - if you just record some changes and clicks in an already |
---|
55 | open window, you need to open that window everytime before you run that macro. |
---|
56 | |
---|
57 | Best practice is to CLOSE ALL SUBWINDOWS before you start recording a macro, then |
---|
58 | open them (again) and then perform your clicks. In that case your macro will run |
---|
59 | regardless whether the window has been opened before or not. |
---|
60 | Note: You can also record "closing a window". |
---|
61 | |
---|
62 | If you want to make sure that some field or toggle is set to a specific value |
---|
63 | by your recorded macro, you need to CHANGE that value. If it already has the |
---|
64 | desired value, change it to something different and then change it back to your |
---|
65 | desired value - otherwise nothing will be recorded! |
---|
66 | |
---|
67 | You may also use this as an feature: If you do NOT change a value during macro |
---|
68 | record, you can change it manually before calling the macro and that way perform |
---|
69 | similar, but different actions with one macro. |
---|
70 | |
---|
71 | This may as well be helpful when using submacros (see below). |
---|
72 | |
---|
73 | SECTION Calling submacros |
---|
74 | |
---|
75 | Macros can call other macros. To do this simply select the macro you like to call |
---|
76 | as submacro and press execute. That will be recorded like any other action. |
---|
77 | |
---|
78 | Calling submacros is a good way to compose complex macros. |
---|
79 | |
---|
80 | It offers you the possibility to change (or fix) small parts of a complex |
---|
81 | macro without the need to record it from scratch. |
---|
82 | |
---|
83 | NOTES You can run macros directly on startup by calling arb by |
---|
84 | |
---|
85 | arb --execute macroname your_database.arb |
---|
86 | |
---|
87 | Such macros can even shutdown ARB, so you can use this to automate ARB. |
---|
88 | |
---|
89 | EXAMPLES You can find some examples in $ARBHOME/lib/macros (this directory is reachable |
---|
90 | in the macro selection box by pressing the ARBMACRO line). |
---|
91 | |
---|
92 | SECTION Enhanced techniques |
---|
93 | |
---|
94 | Macros are perl scripts. So if you know perl or have someone @ your lab who does |
---|
95 | or just feel keen enough, macros can be easily extended to act more sophisticated. |
---|
96 | |
---|
97 | Some examples: |
---|
98 | |
---|
99 | * to create a macro that works with the CURRENTLY SELECTED alignment |
---|
100 | - record a macro using an explicit alignment (e.g. 'ali_16s') wherever needed |
---|
101 | - edit the recorded macro file: |
---|
102 | * above the 1st '# recording started'-line insert the following lines: |
---|
103 | |
---|
104 | my $ali_selected = BIO::remote_read_awar($gb_main,'ARB_NT','presets/use'); |
---|
105 | if ((not defined $ali_selected) or ($ali_selected =~ /\?/)) { |
---|
106 | die "Please select a valid alignment"; |
---|
107 | } |
---|
108 | |
---|
109 | * below replace all |
---|
110 | |
---|
111 | occurrences of with |
---|
112 | 'ali_16s' $ali_selected |
---|
113 | |
---|
114 | Note the single quotes! |
---|
115 | |
---|
116 | * to create a macro that works with two corresponding dna and protein alignments |
---|
117 | - record a macro using two explicit alignments (e.g. 'ali_dna' and 'ali_pro') wherever needed |
---|
118 | - edit the recorded macro file: |
---|
119 | * above the 1st '# recording started'-line insert the following lines: |
---|
120 | |
---|
121 | use lib "$ENV{'ARBHOME'}/PERL_SCRIPTS/lib"; |
---|
122 | use ali_dnapro; |
---|
123 | my ($ali_dna,$ali_pro) = get_dnapro_alignments($gb_main); |
---|
124 | |
---|
125 | * below replace all |
---|
126 | |
---|
127 | occurrences of with |
---|
128 | 'ali_dna' $ali_dna |
---|
129 | 'ali_pro' $ali_pro |
---|
130 | |
---|
131 | Note the single quotes! |
---|
132 | - Notes: |
---|
133 | * works only if the alignment names contain 'dna' and 'pro' and both |
---|
134 | only differ by these terms. |
---|
135 | * you may select either the dna or the protein alignment before |
---|
136 | running the macro. |
---|
137 | |
---|
138 | The method used in the first example above also works for other |
---|
139 | selected things, like |
---|
140 | |
---|
141 | * the selected tree using |
---|
142 | |
---|
143 | my $tree_selected = BIO::remote_read_awar($gb_main,'ARB_NT','focus/tree_name'); |
---|
144 | |
---|
145 | * the LINK{selected.hlp} using |
---|
146 | |
---|
147 | my $species_selected = BIO::remote_read_awar($gb_main,'ARB_NT','tmp/focus/species_name'); |
---|
148 | die "no species selected" if not defined $species_selected; # show error in ARB message window and abort |
---|
149 | |
---|
150 | * the current cursor position in the editor |
---|
151 | |
---|
152 | my $cursor_position = BIO::remote_read_awar($gb_main,'ARB_NT','tmp/focus/cursor_position'); |
---|
153 | |
---|
154 | |
---|
155 | WARNINGS None |
---|
156 | |
---|
157 | BUGS None |
---|