Changing HTM file

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Changing HTM file

Post by lcrltd » Tue Feb 15, 2011 10:41 am

Is there a way to use Scheduler to change the background colour on a local html file.

It is being exported by a 3rd party with the background colour always set to white, I would like to change it to black.

""

Is the line

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Post by adroege » Tue Feb 15, 2011 11:25 am

Is there a way to use Scheduler to change the background colour on a local html file.
Sure. There are plenty of File I/O functions and String processing functions to perform this task. There are also RegEx (regular expressions) support to make this task easier.

lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Post by lcrltd » Tue Feb 15, 2011 11:39 am

Any pointers would be mightily appreciated.

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

Post by Marcus Tettmar » Tue Feb 15, 2011 11:50 am

1. Read in the .htm file with ReadFile
2. Replace occurences of with
3. Write back to .htm file

So, something like:

Let>filename=c:\bla\index.htm
ReadFile>filename,htmlFile
StringReplace>htmlFile,,,htmlFile
DeleteFile>filename
WriteLn>filename,res,htmlFile
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

lcrltd
Junior Coder
Posts: 35
Joined: Thu Nov 16, 2006 8:23 am

Post by lcrltd » Tue Feb 15, 2011 11:55 am

Thank you very much, that worked a treat!

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