Posts: 276
Threads: 34
Joined: Dec 2016
For example: When I type (imc), I can automatically enter the following lines of code,Thanks in advance, any advice is welcome
Macro
Macro1
Trigger
SF9
IDispatch iim._create ( "iMacros" )
int status= iim.iimOpen( "" )
str macro
macro=
;VERSION BUILD=7500718 RECORDER=FX
;TAB T=1
;URL GOTO=http://demo.imacros.net/Automate/Filter
status= iim.iimPlayCode( macro)
mes "press ok to next"
macro=
;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
status= iim.iimPlayCode( macro)
Posts: 763
Threads: 261
Joined: Jul 2012
I do not know if the following is of any use, but I will mention it any way.
With "Autotext" (Above in menu, File >> New >> New Autotext List) Autotext lists are used to execute commands when you type certain text.
Whenever you type @typethis@, the text defined within _s in function "typethis" is placed.
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
Can write to a file? I tried it, the following code, run-time, error, can give pointers about it, thank you, if I have a lot of text to be defined in a number of documents will be more trouble
Attached Files
Image(s)
Posts: 763
Threads: 261
Joined: Jul 2012
Autotext only supports commands on one line, but you could enter multiple commands on one line by separating them with ";"
Autotext
Autotext3
Trigger
$t
;FORMATTED TEXT EXAMPLES
dt : str s.timeformat ( "{DD} {T}" ); key ( s) ;;current date and time. To add the code, you can use the Text dialog from the floating toolbar.
The above example is from the above menu:
File >> New >> New Autotext List >> Working with sample items
If you need to do a lot of actions or something complex then do it in a seperate function (like the "typethis" example).
Posts: 276
Threads: 34
Joined: Dec 2016
Yes, only one line of command, but if my code is a lot of lines, it is not convenient, the need to manually adjust the code, but the code to read up on the difficult, not easy to maintain! I hope QM developers can enhance this feature, to support multi-line code definition!
Previously, I made a post, it is recommended to add a very useful feature, I hope you can look at the way to support my suggestions, thank you very much!
It is recommended to add a collection code utility button!
Posts: 12,073
Threads: 140
Joined: Dec 2002
Use the Text dialog to create the AutoText item. Paste the multiline text, select Paste, click OK. Then replace "text".
imc : "IDispatch iim._create(''iMacros'')[]int status=iim.iimOpen('''')[]str macro[][]macro=[];VERSION BUILD=7500718 RECORDER=FX[];TAB T=1[];URL GOTO=http://demo.imacros.net/Automate/Filter[]status=iim.iimPlayCode(macro)[][]mes ''press ok to next''[][]macro=[];TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT=''Image Filter''[]status=iim.iimPlayCode(macro)"
If want visual multiple lines, in the dialog check Multiline.
imc : sub.Sub1
#sub Sub1 m
_s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s
Posts: 276
Threads: 34
Joined: Dec 2016
OK, I can run successfully, this is a way, thank you very much for technical support
However, for some beginners feel the trouble! If I use the following code can be achieved, it would be great!
The code a little less, also easy to read
Autotext
Autotext
Trigger
$t
/b/i/c/p3
imc : str s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste s
Posts: 276
Threads: 34
Joined: Dec 2016
I follow the above method, create a new AutoText (amc) but the code can not run, where the error? thank you very much
Autotext
Autotext
Trigger
$t
/b/i/c/p3
imc : sub.Sub1
#sub Sub1 m
_s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s
amc : sub.Sub2
#sub Sub2 m
_s2=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s2
Posts: 12,073
Threads: 140
Joined: Dec 2002
All autotext items must be above the first #sub.
Move amc
ub.Sub2 to the beginning.
Posts: 276
Threads: 34
Joined: Dec 2016
Recommendation: I can create an AutoText directly from the (text dialog) (for example, the following image)
Select the Create AutoText check box to create a new AutoText file
The Add to drop-down box can be added to the specified AutoText file
(Abridge box) In the box here, I can define acronyms
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
Gintaras Wrote: All autotext items must be above the first #sub.
Move amc ub.Sub2 to the beginning.
Into the front, but can not run correctly
Autotext
Autotext
Trigger
$t
/b/i/c/p3
imc : sub.Sub1
amc : sub.Sub2
#sub Sub1 m
_s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s
#sub Sub2 m
_s2=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s2
Posts: 12,073
Threads: 140
Joined: Dec 2002
Posts: 276
Threads: 34
Joined: Dec 2016
kyjdp Wrote: Recommendation: I can create an AutoText directly from the (text dialog) (for example, the following image)
Select the Create AutoText check box to create a new AutoText file
The Add to drop-down box can be added to the specified AutoText file
(Abridge box) In the box here, I can define acronyms
I hope QM developers, to consider this feature,
For us: too stupid, do not understand the programming code too helpful
With this feature, all operations are too simple
Posts: 276
Threads: 34
Joined: Dec 2016
Gintaras Wrote: Must be _s, not _s2.
Finally succeeded, but if more AutoText, the code is not easy to read, not easy to maintain
Hope that in the future version, the code below, it can run successfully
/b/i/c/p3
imc
tr s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste s ;; or key (s)
Posts: 276
Threads: 34
Joined: Dec 2016
I write the following code, easy to read, and easy to maintain
Autotext
Autotext
Trigger
$t
/b/i/c/p3
imc : sub.imc
amc : sub.amc
#sub imc m
_s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s
#sub amc m
_s=
;IDispatch iim._create("iMacros")
;int status=iim.iimOpen("")
;str macro
;
;macro=
;;VERSION BUILD=7500718 RECORDER=FX
;;TAB T=1
;;URL GOTO=http://demo.imacros.net/Automate/Filter
;status=iim.iimPlayCode(macro)
;
;mes "press ok to next"
;
;macro=
;;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
;status=iim.iimPlayCode(macro)
paste _s
Posts: 276
Threads: 34
Joined: Dec 2016
I will set the code above the prefix: @, when I importation @amc, the code becomes the following, @ amc also retained, I hope to help look, very grateful
Macro
Macro2
@ amcIDispatch iim._create( "iMacros" )
int status= iim.iimOpen( "" )
str macro
macro=
;VERSION BUILD=7500718 RECORDER=FX
;TAB T=1
;URL GOTO=http://demo.imacros.net/Automate/Filter
status= iim.iimPlayCode( macro)
mes "press ok to next"
macro=
;TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:textfield CONTENT="Image Filter"
status= iim.iimPlayCode( macro)
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
Has been resolved, forget to add the following fields
/b/i/c/p3
Posts: 276
Threads: 34
Joined: Dec 2016
It is recommended to add the AutoText button on the floating toolbar, so that the operation will be more simple, the following picture
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
It is recommended to add a global hotkey to the AutoText, and I can create the selected text as AutoText directly! The picture below !
Select the text, press ctrl + shift + Alt + A hotkey will copy the selected text to the AutoText window, and then you can directly set the relevant options, this will be very convenient
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
AutoText, is a very useful feature, add the above global hotkey and set window, will be very intuitive, simple, easier to use
Posts: 276
Threads: 34
Joined: Dec 2016
I redesigned the programming logic
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
I would like to AutoText, generate exe file, shared with my friends to use, but when the generated error
QM does not support AutoText to generate exe files? If it can be generated on the great, AHK can be achieved
Attached Files
Image(s)
Posts: 12,073
Threads: 140
Joined: Dec 2002
Autotext in Quick Macros 2 is not supported in exe.
Posts: 276
Threads: 34
Joined: Dec 2016
I look forward to the future version can support the generation exe file, because can generate exe, AutoText will be very useful,
Posts: 276
Threads: 34
Joined: Dec 2016
Recommendation: Multi-line AutoText, like the following picture so, it looks very simple, clear, if the show in a row, not easy to maintain and manage
If a multi-line AutoText is defined as a subroutine, do not understand the programming people, understand some difficulties
Attached Files
Image(s)
Posts: 276
Threads: 34
Joined: Dec 2016
Suggest:
Add a global hotkey (Ctrl + Alt + Shift + A) and a AutoText button (floating toolbar), see the following image
This dialog box can greatly facilitate the creation of AutoText, At any time, see good code, you can press a hot key: Ctrl+Alt+Shift+A to define your own AutoText
I think the use of QM can add such a function, but my programming level is not good, not the ability to achieve this function, I hope the developer can help me,
I think that this is also a good learning programming case that helps improve the level of programming,
Thank you very much
Forum programming master, can try it , too 8)
Attached Files
Image(s)