Import Binary Data and Dialog Box

Ideas for new features & functions

Moderators: JRL, Dorian (MJT support)

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Import Binary Data and Dialog Box

Post by kpassaur » Wed Dec 03, 2008 8:31 pm

I have made the switch to version 11 and the old scripts are opening just fine now after the update that corrected the Dialog tag. Actually better than fine as the bitmap data is now on one line.

However, when I import a bitmap (now using binary data) it does not import to a line (like the converted ver 10 to 11), but as many lines like ver 10, only worse as one bitmap which was about 1500 lines is now over 12,000 lines.

I tried exiting and opening hopeing that it would reformat to one line but it didn't.

I was reducing the bitmap size and going to just use a header and fill the dialog with one color, which I did. I made the changes, however, in the dialog editor the new bitmap is black, it does not show like before. However when the script is run it runs correctly.

So, I checked on a different script where it converted the bitmap automatically (from ver 10 to 11) and the bitmap displayed in the editor.

So, I think there is a bug in the binary import when using bitmaps.

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Import Binary Files

Post by kpassaur » Thu Dec 04, 2008 1:40 pm

Has anyone else run into the imported bitmap being on multible lines like before or is it just me?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 04, 2008 1:57 pm

This is as designed. There was a discussion about this recently.

If we import into one line the editor will lock up. So with v11 it imports onto multiple lines. This also means other editors can cope. We looked at lots of editors and found most will freeze if they try to open a v10 script containing long lines.

You can either have the ability to have enormous long lines, OR you can have code folding etc.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Import Bitmap

Post by kpassaur » Thu Dec 04, 2008 2:25 pm

I'm missing something here. If I have a ver 10 script and open it in 11 my bitmap is on one line.

If I manually import a bitmap to 11 it is on multible lines (like it was in ver 10) and it does not allow me to fold it up.

Is that how it is suppose to be? If you create it in ver 10 and open it in 11 you can have it on one line, but if you use 11 and add a bitmap you will have to have it on multible lines?

Also, the editor seems to be much slower and the images are black unless you click on them.

A suggestion - this may have been discussed before. When a script is opened in 11 have all the Run Program and Change Directory automatically changed to RunProgram and ChangeDirectory. I am manually doing this and it is very time consuming. My understanding from the notes is that it is backwards compatibale, (I could be mistaked) but it dosen't display in green and if it dosen't to me the command will not run. I have experienced this before on previous versions without the space in Run Command it would run somtimes and somtimes not.

Antother suggestion - this one is probally hard to do, in ver 11 it is very easy to open a dialog in the editor without highlighting it (which is fantastic by the way) however, when you go to paste it you end up with two dialogs unless you highlight the old one. (Sort of defeats the purpose).

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 04, 2008 2:34 pm

Yes, that is how it is supposed to be.

I'll try and explain.

In v10 the import pulled the data into ONE line. It was VERY VERY long. The v10 editor could handle this.

The v11 editor cannot handle these long lines so well. So in v11 the importer imports into multiple shorter lines and places an Exit> statement above them so that you never execute them.

Of course if you open a script made in v10 the data will be on one LONG line. You may find v11 slows up dramatically. I would therefore delete that line and reimport it with the v11 importer.

Either way the script interpreter itself will cope. It can run the script whether the data is on one long line or several.

What do you mean the images are black? Where are they black?

There is no need whatsoever to change the RUn Program and Change Directory lines. They will STILL WORK.

You should only be able to open a dialog if you a) highlight it, or b) have the first line of the Dialog block selected. If that is not the case there is a bug. Can someone tell me how I convince people to find these problems for us DURING beta BEFORE release rather than AFTERWARDS ;-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Dec 04, 2008 2:42 pm

Antother suggestion - this one is probally hard to do, in ver 11 it is very easy to open a dialog in the editor without highlighting it (which is fantastic by the way) however, when you go to paste it you end up with two dialogs unless you highlight the old one. (Sort of defeats the purpose).
I can't address the line length issues since I have no real understanding. But for the dialog editor try this.

- Place the cursor at the beginning of the first line of the dialog, for example at the start of Dialog>Dialog1.

- Right Click in the editor window.

- Select "Edit Dialog1"

After you edit, quit and save your dialog.

- Right Click in the editor window.

- Select "Update Dialog1 From Clipboard"

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 04, 2008 2:50 pm

Also, if you want to change all "Run Programs" to "RunProgram" etc then just use Search/Replace.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Dialogs and Import

Post by kpassaur » Thu Dec 04, 2008 3:29 pm

Okay, now I know and will import the images again.

As for the Beta Testing, I looked at the program and played with it a little bit; however, selling my programs is what I do for a living and I didn't have a lot of time to devote to it. If I don't produce, I don't get paid.

Once I realized that everything that I compiled with the Beta Version, even if it worked would expire, meant to me if you use it and put it out to your clients, you will have issues when the scripts expire. Well I couldn't afford to have software out that is paid for and expiring.

The other issue is always, is it worth upgrading. I love the new editor, but yes a but, it means that I have to convert 800 scripts. Most will require no work, but others will. Yes there are other new features besides the editor as well, fantastic ones, however, they are not ones I that I have come to need.

I think that is the issue with all upgrades, normally you just buy them without thinking, I always have in the past. This has nothing to do with MS, but think about it, is spending another 200 on an upgrade for Office ever really going to pay for itself. Not unless there is some feature you must have and is going to save you time.

I think the new editor in MS will save me time in the long run (a lot of time), and that is the reason I am upgrading.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Dec 04, 2008 3:34 pm

I hope you don't feel you are being forced to upgrade. I believe we have provided a superb new editor without losing anything. There really shouldn't be much conversion needed, and we have made sure as much as possible is backward compatible. But of course you do not need to upgrade. If you feel you have upgraded in error I am more than happy to provide a refund.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Dialog Editor

Post by kpassaur » Fri Dec 05, 2008 8:02 am

I don't feel is if I am being forced to upgrade at all. The new editor is worth it.

However, I am still having issues with the Dialog Editor displaying the imported bitmaps as black. What I mean as black is the entire bitmap becodes a black rectangle. In some cases if you click on it, it will appear, in other cases it will not. In the example below, it is one black box.

Perhaps it is me, here is a sample (I am just showing the first couple of lines of the imported bitmap.

Please note it displays fine when the program is run.

Dialog>Dialog1
Caption=Dialog1
Width=335
Height=201
Top=208
Left=489
Max=1
Min=1
Close=1
Resize=1
Image=C:\TextSearchTiffs\TST Do not include\Menu Header Small.bmp,0,0,329,65,msImage1,0
Image=TRIALHASEXPIRED.BMP_DATA,64,16,241,25,msImage2,0
EndDialog>Dialog1


Exit>0
TRIALHASEXPIRED.BMP_DATA:
424DF64E000000000000360000002 etc.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Dec 05, 2008 10:03 am

Oops. The dialog designer wasn't updated to handle the multiple line imports. Fixed in 11.0.29 which you can download now.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Dialog

Post by kpassaur » Fri Dec 05, 2008 10:23 am

Thanks Marcus I will download it now.

I have a suggestion that I think would make MS easier to use.

Have an option on the compiler to include bitmap images, let the compiler pull them from the location specified in the dialog box.

This way it is easy to edit them, no more having to reimport the bitmap every time a change is made. No big blocks of text to manage. No long wait times for the script to load.

Perhaps the large blocks of text have changed with what I am about to download, but the last one I did was over 8000 lines. In order to change it, it was easier to copy the script portion, delete the script, open a new one in the editor and paste the script portion back in.

With this as an option the user would not have to be manually import each bitmap and then change the line in the editor. Therefore it would save time when creating and editing scripts.

It is just a thought, but I know it would make MS easier to use.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Dec 05, 2008 10:39 am

Another option is to import your bitmaps into a separate .scp file and then Include> that .scp file in your main scripts. So you keep bitmaps in an include file. That way it doesn't affect editing of the main script.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Include Option

Post by kpassaur » Fri Dec 05, 2008 11:06 am

I never thought of that, and most of my scripts use the same bitmaps, the only real difference is a line of text.

However, it still dosn't handle highlighting thousands of lines to edit it.

In order to use the Include> efficiently, I would need to create a separate script for each bitmap image. For instance, the one I am working on now contains a Header which is used on three dialogs it is 1500 lines, each of the bitmaps that contain a single line of text (two or three words) are around 500 lines. If I place it all in one file I have 3000 lines to highlight and edit. Which is, I think sort of a pain.

The next option is to create 4 separate scripts and use include. Creating 4 separate scripts is sort of a pain as well. I say this as when I am in the editor and a change needs to be made, I have the image open in another application. I make the change, then refresh the dialog. Once completed, I import the bitmap. With include, I would have to open another script file and edit it or delete it and create a new one.

Now this may not sound like much, but the key to MS is its ease of use.

Also, just curious on include since it calls the script, does it have to be there when compiled. In other words, I have a script, I compile it and it has the include function, when it is run are the contents of the Include script compiled as well or when the script is run does it look for the script file?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Dec 05, 2008 11:25 am

You can have more than one script editor open. So you can have both your main script with dialog and your include script open in two different editor windows - assuming you edit it from outside Macro Scheduler (right click on the .scp file).

You can compile includes INTO your exe, so they are part of the exe. Use the static includes option and either use a static path in the Include> statement or %SCRIPT_DIR% if they are in the same location. Obviously if the Include uses a variable then it cannot be compiled in.

In my testing 3000 lines of text did not affect performance at all. What DID affect performance were files all on one line. We were stuck between a rock and a hard place. To move forward with the editor and make improvements we had to stop using long lines. I looked at lots of well known text editors out there and they all had the same problem. Most locked up completely if you tried to open a v10 script that had an imported bitmap - even a small one. But they all cope when that bitmap import is split over several lines, even if you have millions of lines.

Sounds like the best way forward for you might be an Include .scp for each bitmap. To change the bitmap all you need then do is delete the include file and then reimport, or save a new one over it. You can leave your main script open in the editor and open a new editor window - there's a shortcut to the editor on your desktop, reimport the image then save over the existing import. Done. Your main script doesn't need to be changed. If you make a new image you just open the editor, import the image, save the script then in your main script simply add an Include line at the bottom. No highlighting required. No need to do any copy, cut or paste.

However, I still believe it makes far more sense if you are creating software that you sell or distribute to simply link your images to real files using %SCRIPT_DIR% and then package those bitmap files in your installer and have the installer install them to your program folder. [Using something like Inno Setup to create the installer]. You know, if you create software in VB, C++, Delphi, you name it, you still need a third party installer app (or build one yourself) when it comes to distributing your software - you don't just stuff all runtime required files into the EXE and give someone the EXE on its own. Granted images are compiled into the EXE in resources. But Macro Scheduler is an interpreter, not a real compiler and there are nearly always other files and settings that need to be installed by an Installer.

If it's any help, the install creator we use lets you simply drag and drop all required files into it. For a basic install you pretty much then just hit compile and it creates an installer containing all the required files which are installed into the program folder when the user installs. This would be ideal if you are creating apps with Macro Scheduler that you distribute which require images. Just my 2p.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts