Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gintaras and QM experts......one line macro request
#1
Hi all,


I need to create a new folder. Do we have a one line macro to do this?

say I want to create the folder "C:\Temp\Preference"

Also what is the script to go to the "desktop" subfolder on C:? (Each Window version may vary)

I searched on the forum but I was not successful.

Thanks,

Josh,
California
#2
These things are in floating toolbar.
Special folders - look for SF button.
#3
To make a directory, really simple and one line:
mkdir("C:\Temp\Preference")

Usually in code, I test if a directory exists first, that way you can run the code as many times as you need without creating the directory each time.

if !();mkdir()

QM uses markup for special folders: Desktop is $desktop$/
Windows uses similar for cmd line: %windir%
#4
%windir% also can be used. You can find it in SF menu, in 'Environment variables' submenu.

mkdir does nothing if the folder exists. Or use if(!dir(folder 1))
#5
Thanks Gintaras! I was wondering if the directory test could make the folder.
#6
TheVig,

Congratulations. This one line macro works great just like a dos command.

"QM, the one line macro" is our new motto. Keep it up guys as we are getting there.
It is best that this is added in the program directly. Post this on your headline and more buyers will come.

One advice I have is to create all these one line macro in a Forum New directory:


"QM, the one line macro".

example:

Topic: to make or create a directory
Contributed for QM update by: TheVig
Approved by: Gintaras/Staff
When: July 18,2010

Thanks for believing but I leave it to Gintaras to decide.

Josh,
California
#7
I really like your idea for creating a section in the forum for "One Line Macros" Put it right at the top. Generate a .qml to import directly into QM that is compiled from the forum. These could be boiled down functions as well, a twist on already present functions that have put them into a very easy to use line. I know I'd put a few up that I made.

Creating text in a text file, making directories, manipulating text, getting text from a webpage, receiving/sending email, and other common things users waste time on.

A place for little quick solutions. Things a beginner user can use that will give them a sense of empowerment. I remember how awesome I thought it was that I could pop up a message box and then dialogs. That's what made me stick with QM and learn as much as I have. Every little thing I learned how to make my computer do through code gave me a sense of "Taking Control" of my machine one line at a time.

What about that...Quick Macros, "Take control of your machine, one line at a time."
#8
TheVig,

I am all for it.. We love to hear from other
QM experts and the novice users as well for their participations.

QM, the one line macro.

As a good example since you mentioned emails . Let us give considerations to the novice users. Just for the email
feature. The presentations should be in sequence.

Not only is it one line macro but one time macro to follow. Only three steps

Step 1 setting up email account.
give example(s) that work
Step 2 sending an email
give example that works in gmail
give example that works in yahoo mail
give example that works in other universal email system
Step 3 receiving an email
give example that works(same as above)

Last resort when nothing works is bother reading and searching on the forum
or keep bothering Gintaras for solutions. I think Gintaras will be busy with his
one line macros and might just give up one day. The honest question then is
how long did it take one novice to send a successful email thru QM? Let us hear from the
experts or from a novice.

One more late breaking scope. I just tested the best ftp feature of
file" uploading" /downloading progress. It shows the file name being downloaded, the total size of the
file and the progressing download/upload feature and surely It works like a charm. Again, this is a one line macro that
our QM guru Gintaras just concocted to his beta version 2.3.2.7. Hang on tight guys for its future
release. I would like to thank him for letting me the first tester. Ooooppppsss, I got carried away as I want
my story to be everything short and simple.

Thanks ,

Josh
California
#9
Gintaras,

Congratulations on your new version 2.3.2.8. Now I see more run examples and majority is one line macro.
I am eager to test your new documentations/presentation on password encyption/decryption technique and may workout some of your examples.
I shall report when I get stucked or stumbled. Presently, I could not find anything working on e mails yet as icons are immobilized. I guess
Gintaras must be working on it again. I expect 3 simple steps....Setup, email send, email receive and lots of working examples.

QM, the best "one line macro"
Main Objective: Keep price low
Simple and one line macro
Lots of examples to comprehend easily without having a need to bother our guru
Best documentations
Keeping members/users intact
Create a forum folder for QM one line macro(s) ......waiting for TheVig/Pi/Mr Gray/......we need some action from
the programmers.
Here is a good example to follow.
Winautomation has a sample of email addresses in Excel and user is able to extract from the excel database, each email recipient
being sent the same email content at a programmed time of the day( for example midnight 12:00 midnight to 1:00 a.m.)
Can any QM expert come up with the shortest one line macro to do this?


Josh
of California
#10
Josh, thank you.

Currently I don't work in this direction.

Email functions are quite complex. You can use the dialogs to create the code.

In the past I used a similar macro: get password from xls file and fill form or something. I can help you to create such macro, but of course it will not be 1 line.
#11
Gintaras,

Thanks for your feed and it is good to hear from you. This is what I noticed on the latest version 2.3.2.8.

The one line features can be found in help reference and with ? as subscript. This would have been
appreciated if those instructions with diamond prefixes on the main program are replaced instead as
archive or at the back as old favorites. They should be replaced by the one line macros from the reference.

Gintaras, I know it takes time to clean up your program but please believe me. Your work will
be appreciated more if you do it the shortest one line macro. Do not hide these on the BACKGROUND
instead these are what you need to show the world IN FRONT main part of your program.
Of course it will take more iterations . I salute you as you have accomplished so much in a short span of time.

Also lastly, I hope you understand the majority part of us as novice users and we care and love you man.

Sincerely,

Josh
of California
#12
One line is easy. Just need big function behind it.
Here's the one line email function:
Code:
Copy      Help
MassEmail

Now what does that do? One specific thing and that's it. It's not versatile at all.
See, the xls file must be hardcoded...the email message would be hardcoded too...when to send...how often...what account....the list goes on and on.

Ok, so specify all these little things....and you still have something that is terribly specific.

Ok so you want it versatile? Well, then the variables become just as complex and probably even more cryptic than just writing the code.

One of the most versatile one line macros in QM:
int ShowDialog([$macro] [dlgproc] [!*controls] [hwndowner] [flags] [style] [notstyle] [param] [x] [y] [$icon] [$menu])
flags: 1 nonmodal, 2 macro is DD, 4 set style (default is to add), 64 raw x y.

Still that falls short and needs to be manipulated from time to time, and that's if you can even figure out all of the ways to manipulate what is already there.

The beauty of programming is in the imagination. If you don't have imagination and you need something done....ask your IT guy to figure it out for you.
#13
Gintaras and QM experts,

When we say we are novice user(s), it does mean we are novice users of QM but it does not mean we are total strangers to other
programming languages or scriptings. Truly, TheVigs is right about asking the IT people for any assistance when you are approaching
some difficult complexities. Come on, we need some feeds/opinions from the other QM experts.

The requested e mailing example is of course not a one line macro but rather preparing us to use the one line macro that Gintaras
already provided that is applicable to each pertinent step. Start with basic and simple logic. I firmly believe, TheVigs has a good solution
to share with us by this time.

Excel example data: Cell B2 "Title" say Mr, Mrs, Miss, Dr. or Chair, Atty, Engr.
Cell B3 for first name and last name
Cell B4 for email addresses
( I shall try to post a good excel file to begin with and I invite all QM users , not just the experts but all, to participate)
Watch for it...with permission from Vigs and Gintaras, I shall post my email, The Vigs and Gintaras support
site.............it will be for our test.)

Email setup: How many one line macro?
Email content: How many one line macro?
We shall take the suggestions of TheVigs for the macro's name as MassEmail.
Think of it as macro of macros.
Timed scheduled automation: How many one line macro
(If our competitor Winautomation can do it, we should be able to do it better with QM,our one line macro)

If you go to any of our competitor sites, say just "Automate" and "Macro Scheduler",
their emphasis are for the users who do not do programming at all. Everything either "drag and drop" or interactive.
Do we know why? Of course we do. Because there are more buyers who do not want to tinker with programming.
They just want results right away. This is the business trend whether we like it or not.

Visit our competitors sites so you can believe me.

Sincerely,

Josh
of California
#14
Gintaras,

I need your help to set us up. I have the excel file ready to upload.
I have 2 versions: MassEmail07.xlsx and MassEmail97.xlx. One for Excel 97 and the other for Excel 2007.
Please send me your link to do this as it does not accept uploads in this format.

Thanks,

Josh
of California
#15
Why link?
#16
I have to repeat.... the upload icon does not take xls nor xlsx files. In the file I use the INDEX command
more than the VLOOKUP as it is shorter. I am pretty sure everybody will appreciate it more when we use
Gintaras one line macro commands.....the clean one line macros may be found on QM on line help with prefixes
of "o".
http://www.quickmacros.com/help/
The documentations here in my opinion are clean, simple to understand and much better than anywhere you can find.
I just wish these are parts of the main program itself.

Thanks,

Josh
of California
#17
You can put files in zip.

Also please remind what is the task/question.

--------------

When you want to add something important to a post, better make new post, because I don't receive notifications about edited posts.
#18
To all participants,

The steps required are shown on the excel file (See attached). Each must drop a line , suggest, give opinions...anything
to be active.

QM, the one line macro.

Thanks and good luck to all and let the game begins,

Josh
of California


Attached Files
.zip   MassEmail97.zip (Size: 9.99 KB / Downloads: 862)
#19
Josh,

Most of your work is done right here in the excel file.

I'm not too up on writing the macros for excel, but you could just have it grab all the necessary data and write that to an external file.

Have QM monitor for file changes....there's even a way to write this as an executable so QM does not have to be running on a machine.

Basically all you need is QM to handle the smtp mailing.

Jim
#20
Function MassEmail97
Code:
Copy      Help
;change these

int debug=1 ;;set to 0 to actually send. If 1, displays message source and does not send.
str xlsFile="$desktop$\MassEmail97.xls"
int startRange=4 ;;Excel row index of the first recipient
int endRange=5 ;;Excel row index of the last recipient
str sendersName="David"
str subject="Test MassEmail97"
str message=
;Message text.
;Message text.

;________________________

if(debug) out ;;clear output

ExcelSheet es.Init("" 8 xlsFile) ;;open the file in hidden Excel process
ARRAY(str) a
es.GetCells(a F"B{startRange}:D{endRange}") ;;get the specified range into 2-dim array

SmtpMail sm
int i
for i 0 a.len ;;for each row
,str body=F"{a[0 i]} {a[1 i]},[][]{message}[][]Sincerely, {sendersName}[]"
,if(debug)  out F"------------ to {a[2 i]} --------------[]{body}"
,sm.AddMessage(a[2 i] subject body)

int flags=0x100 ;;progress dialog
if(debug) flags|0x10000|0x20000 ;;don't send; preview
sm.Send(flags) ;;send using default accout. You can set it through 'Send email message' dialog.

And set schedule through Properties dialog.
#21
To all,

I thank our QM guru , Gintaras, to be coming out with a suggested way so fast he is a real grandmaster. I also thank Jimmy Vig for his suggestion of "MassEmail".

Everyone must try this routine and see if it works for you. Also you may have an enhancement suggestion/shorter routine.
This is just the beginning...so please participate. A gift is waiting to be given only if you participate and I am serious.

Thanks,

Josh
of California
#22
To all,

I had the privilege to test Gintaras routine and it works great. Now the next question is
the moment we change 1 to zero...then what?

";;send using default account. You can set it through 'Send email message' dialog."
Gintaras suggested

I see all his e mail sending instruction as complex and tedious. I hope he is kind enough
to guide us thru the end of this remembering that we are novice users afterall. His dialogue is
lengthy but hope he understands and forgive me for saying "We need another oversimplification from here".

click functions ,internet, mail smtp mail.....

Example:

For a gmail account holder set up

Thanks,

Josh
of California
#23
Quote:I see all his e mail sending instruction as complex and tedious.

Yes, you have to know your email account data. It is like you manually set an account in an email program - Outlook, Thunderbird...

For gmail it is

Code:
Copy      Help
smtp_server smtp.gmail.com
smtp_port 465
smtp_user [email protected]
smtp_auth 2
smtp_secure 1
smtp_timeout 30
smtp_email [email protected]
smtp_displayname "Your display name"
smtp_replyto ""
pop_server pop.gmail.com
pop_port 995
pop_user [email protected]
pop_auth 0
pop_secure 1
pop_timeout 30

Create new account, click 'From string' button, paste this text, OK, enter password, change personal details. OK. In 'QM Email Settings' dialog check 'Default' for this account.
#24
Gintaras and all,

It seems I am out of luck with the Outlook Express download so I can get quick macro to work with for sending/receiving emails. Unfortunately I have a 64 bit platform on my window computer and the OE has its limitations. When I run the Q mail setup and where I press the "from" icon, it keeps giving me an input page and I do not know what to do with it. What is this input page anyway? What does it do? Does anybody have a suggestion?

Thanks for any help,

Josh
of California
#25
Quote:It seems I am out of luck with the Outlook Express download so I can get quick macro to work with for sending/receiving emails. Unfortunately I have a 64 bit platform on my window computer and the OE has its limitations.
You don't need Outlook Express for QM email functions. But if you have OE, QM functions can use its email account settings. If you don't have OE, you need to create account in QM.


Quote:When I run the Q mail setup and where I press the "from" icon, it keeps giving me an input page and I do not know what to do with it. What is this input page anyway? What does it do? Does anybody have a suggestion?

Read the last line from my previous post.
#26
Gintaras and all,

OK good news. I was able to decipher the way to do it without hazzle.

To run MassEmail in real time


First run Mail Setup using the steps from QM click in sequence:
System
Functions
Internet
Mail
Email help to run Mail Setup
Input the setup that Gintaras suggested say for email...try it your own setup

then change Gintaras MassEmail macro routine second line int debug=0 1 change to 0
Test run and you should be able to do it yourself.

Wholeheartedly I thank TheVigs and Gintaras for their effort.

Since now we suceeded in sending email message what is next for Gintaras assistance?
A question may pop up...........How do we make attachments................using a one line macro?
Another question may pop up. How do we trigger time in QM say let the program wake up at 1:30 a.m. and start sending this mass e mail?

Lastly, we would love to hear from the testers/programmers for any optional routines.

Josh
of California
#27
Gintaras,

I have a bit of concern. I would like to change to interactive prompts for:
int debug
int startRange
int endRange so values would change outside the script making it more iterative.

Please give your preference steps for this.....perhaps a one line macro if possible.

also on the str message, there seems to have a requirement to set up margins....like when margin for the
text is exceeded it keeps on showing some weird numbers as i.e. =20...or so. Kindly elaborate for our
understanding and guide us how to set it properly.

A million thanks,

Josh
of California
#28
For single variable could be used inp (dialog available in floating toolbar), but we probably don't want 3 inp dialogs. Then create custom dialog. Example:

Macro Macro1470
Code:
Copy      Help
\Dialog_Editor

int v1 v2 v3

str controls = "4 6 8"
str e4 e6 e8
e4=v1; e6=v2; e8=v3
if(!ShowDialog("Macro1470" 0 &controls)) ret
v1=val(e4); v2=val(e6); v3=val(e8)

out F"{v1} {v2} {v3}"

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Static 0x54000000 0x0 4 6 48 12 "var1"
;4 Edit 0x54030080 0x200 58 4 96 14 ""
;5 Static 0x54000000 0x0 4 22 48 12 "var2"
;6 Edit 0x54030080 0x200 58 20 96 14 ""
;7 Static 0x54000000 0x0 4 38 48 12 "var3"
;8 Edit 0x54030080 0x200 58 36 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2030208 "" "" ""

-------------------------------

Quote:when margin for the
text is exceeded it keeps on showing some weird numbers as i.e. =20...or so.

How it looks? Can you post screenshot?
#29
To all,

Hereunder as attached is the image for the code that illustrates the interactive script for interactive prompt that may help the novice user:
Try it and send your comments for your findings. (Scroll the image to see the full picture)


.........while for the dialog devised by Gintaras do not forget to start with File ,New, New Dialog

Thanks,

Josh
of California


Attached Files Image(s)
   
#30
Gintaras and all,

Can you confirm this (Applicable to all gmail emails with attachments in exe format).

If we use gmail system, I am aware that if I am uploading(or attaching) a file as an exe file that you cannot send it as an attachment file
for the gmail security system. Have you tried enclosing the exe file on a folder then zip the folder. Do you think this might solve the problem?

Say for this example in the MassEmail program that I am attaching any QM macro in exe file.
Changing the exe file to zip file (by using pkzip, winzip, 7zip or just zip it ) gmail can still trace it as an exe file. Could you
advise me the best way to send an exe file indirectly on the gmail system using QM one line macro or anything shorter.

Please set me up for the MassEmail macro to do this. Kindly attach some working explanations. This , I am sure will help anybody
using the gmail system via the QM.

Thanks a lot,

Josh
of California


Forum Jump:


Users browsing this thread: 4 Guest(s)