Publish a Web site using FrontPage

This script automates Web site publishing. USE WinTask FTP functions to upload the files you want to your FTP server. The script below has to be used only with a WinTask version older than 3.7.

You can find the corresponding script file under Script_Examples, sub-directory of scripts

 

'Script for Windows XP and FrontPage

 

'*****************************************************************************

' Set up some variables

'*****************************************************************************

'name of the EXE for FRONTPAGE

my_exe$="C:\Program Files\Microsoft Office\Office\FRONTPG.EXE"

'location of the site to be published

site$="c:\my documents\my Webs"

'Web url

url$="http://www.wintask.com"

 

'User ID authorized for publishing

id$="wintask-web"

'password for this user ID

pswd$="zzzzzzz"

'*****************************************************************************

 

#executedelay=1

#sendkeysdelay=2

 

'launch frontpage

shell(chr$(34)+my_exe$+chr$(34))

 

'pause to be sure FrontPage is loaded

pause 15

 

'use keyboard shortcuts, since FrontPage menus are non-standard

UseWindow("FRONTPG.EXE|FrontPageEditorDocumentView|Microsoft FrontPage -|1",1)

SendKeys("<Alt f>W")

pause 2

UseWindow("FRONTPG.EXE|RichEdit20W|Open Web|2",1)

SendKeys(site$)

 

UseWindow("FRONTPG.EXE|bosa_sdm_Mso96|Open Web",1)

ClickMouse(Left,Down,554,337)

ClickMouse(Left,Up,554,337)

 

'publish Web menu

UseWindow("FRONTPG.EXE|FrontPageEditorDocumentView|Microsoft FrontPage -|1",1)

SendKeys("<Alt f>h")

pause 1

 

UseWindow("FRONTPG.EXE|#32770|Publish Web",1)

WriteCombo("1",url$)

Click(Button,"&Publish")

 

'wait for the password window

i=0

repeat

i=i+1

pause 100 ticks
EndPause

until existw("FRONTPG.EXE|#32770|Name and Password required")=1 or i>200

 

pause 1

 

'type userid and password, then click OK

UseWindow("FRONTPG.EXE|#32770|Name and Password required",1)

WriteEdit("1",id$)

WriteEdit("2",pswd$)

UseWindow("FRONTPG.EXE|#32770|Name and Password required",1)

Click(Button,"OK")

 

 

'wait until the site is published

Pause until

Text("Publishing")

InWindow("FRONTPG.EXE|msctls_statusbar32|Microsoft FrontPage -|1",1)

PauseFalse

MsgBox("'Wait for' at line " + #ErrorLine$ + " has failed !",16,"Runtime error")

End

EndPause

 

 

'If the site has already been published, a message asks if the previous one can be deleted.

'then wait until FrontPage has finished publishing

i=0

repeat

i=i+1

if existw("FRONTPG.EXE|#32770|Do you want to overwrite this file ?")=1 then

UseWindow("FRONTPG.EXE|#32770|Do you want to overwrite this file ?",1)

Click(Button,"&Yes for all")

endif

Pause 2 secs until

Text("Web site published")

InWindow("FRONTPG.EXE|Static|Web site published.",1)

PauseOK

'If OK, close FrontPage and end of the script

UseWindow("FRONTPG.EXE|#32770|Microsoft FrontPage",1)

Click(Button,"End")

CloseWindow("FRONTPG.EXE|FrontPageExplorerWindow40|Microsoft FrontPage -",1)

msgbox("Publication OK")

end

EndPause

 

until i>1000

 

'if wait has a problem, we display a message

msgbox("problem")