Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Define AutoText for Multiple Lines of Code
#1
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     Help - how to add the trigger to the macro
Code:
Copy      Help
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)
#2
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)
       
#3
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)
   
#4
Autotext only supports commands on one line, but you could enter multiple commands on one line by separating them with ";"

Autotext Autotext3
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
;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).
#5
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! Tongue

It is recommended to add a collection code utility button!
#6
Use the Text dialog to create the AutoText item. Paste the multiline text, select Paste, click OK. Then replace "text".

Code:
Copy      Help
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.

Code:
Copy      Help
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
#7
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! Tongue

The code a little less, also easy to read

Autotext Autotext
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/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
#8
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     Help - how to add the trigger to the macro
Code:
Copy      Help
/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
#9
All autotext items must be above the first #sub.
Move amc Confusedub.Sub2 to the beginning.
#10
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)
   
#11
Gintaras Wrote:All autotext items must be above the first #sub.
Move amc Confusedub.Sub2 to the beginning.

Into the front, but can not run correctly

Autotext Autotext
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/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
#12
Must be _s, not _s2.
#13
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 Idea Idea Idea

With this feature, all operations are too simple Big Grin
#14
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 Smile

/b/i/c/p3

imc Confusedtr 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)
#15
I write the following code, easy to read, and easy to maintain

Autotext Autotext
Trigger $t     Help - how to add the trigger to the macro
Code:
Copy      Help
/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
#16
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
Code:
Copy      Help
@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)
   
#17
Has been resolved, forget to add the following fields Big Grin


/b/i/c/p3
#18
It is recommended to add the AutoText button on the floating toolbar, so that the operation will be more simple, the following picture Tongue


Attached Files Image(s)
   
#19
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 Smile


Attached Files Image(s)
   
#20
AutoText, is a very useful feature, add the above global hotkey and set window, will be very intuitive, simple, easier to use Tongue
#21
I redesigned the programming logic Smile


Attached Files Image(s)
   
#22
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)
   
#23
Autotext in Quick Macros 2 is not supported in exe.
#24
I look forward to the future version can support the generation exe file, because can generate exe, AutoText will be very useful, Smile
#25
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 Tongue

If a multi-line AutoText is defined as a subroutine, do not understand the programming people, understand some difficulties


Attached Files Image(s)
   
#26
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 Big Grin

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 Smile

Forum programming master, can try it , too 8)


Attached Files Image(s)
   


Forum Jump:


Users browsing this thread: 1 Guest(s)