You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,27 @@ It is possible to execute a script from `QScripts` without having to activate it
31
31
32
32
It is possible to instruct `QScripts` to re-execute the active script if any of its dependent scripts are also modified. To use the automatic dependency system, please create a file named exactly like your active script but with the additional `.deps.qscripts` extension. In that file you put your dependent scripts full path.
33
33
34
-
When using Python, it would be helpful if we can also `reload` the changed dependent script from the active script automatically. To do that, simply add the directive line `/reload` along with the desired reload syntax. For example, here's a complete `.deps.qscripts` file with a `reload` directive:
34
+
When using Python, it would be helpful if we can also `reload` the changed dependent script from the active script automatically. To do that, simply add the directive line `/reload` along with the desired reload syntax. For example, here's a complete `.deps.qscripts` file with a `reload` directive (for Python 2.x):
35
35
36
36
```
37
37
/reload reload($basename$)
38
38
t2.py
39
-
//This is a comment
39
+
// This is a comment
40
+
t3.py
41
+
```
42
+
43
+
And for Python 3.x:
44
+
45
+
```
46
+
/reload import imp;imp.reload($basename$);
47
+
t2.py
48
+
// This is a comment
40
49
t3.py
41
50
```
42
51
43
52
So what happens now if we have an active file `t1.py` with the dependency file above?
44
53
45
-
1. Any time `t1.py` changes, it will be automatically re-executed in IDA. That's the default behavior of `QScripts` <= 1.0.5.
54
+
1. Any time `t1.py` changes, it will be automatically re-executed in IDA.
46
55
2. If the dependency index file `t1.py.deps.qscripts` is changed, then your new dependencies will be reloaded and the active script will be executed again.
47
56
3. If any dependency script file has changed, then the active script will re-execute. If you had a `reload` directive set up, then the modified dependency files will also be reloaded.
48
57
@@ -54,6 +63,21 @@ Please note that if each dependent script file has its own dependency index file
54
63
*`$env:EnvVariableName$`: `EnvVariableName` is expanded to its environment variable value if it exists or left unexpanded otherwise
55
64
56
65
66
+
## Using QScripts with trigger files
67
+
68
+
Sometimes you don't want to trigger QScripts when your working scripts are saved, instead you want your own trigger condition.
69
+
One way to achieve a custom trigger is by using the `/triggerfile` directive:
70
+
71
+
```
72
+
/reload import imp;imp.reload($basename$);
73
+
/triggerfile createme.tmp
74
+
75
+
// Just some dependencies:
76
+
dep.py
77
+
```
78
+
79
+
This tells QScripts to wait until the trigger file `createme.tmp` is created before executing your script. Now, any time you want to invoke QScripts, just create the trigger file. The moment QScripts finds the trigger file, it deletes it and then always executes your active script (and reloads dependencies when applicable).
80
+
57
81
## Using QScripts programmatically
58
82
It is possible to invoke `QScripts` from a script. For instance, in IDAPython, you can execute the last selected script with:
0 commit comments