Vbs script won't launch


#1

Hello, this vbs script

'--------------------------
Set objFSO=CreateObject(“Scripting.FileSystemObject”)

'Create a file that triggers MountWeather to update the Mount
dim CurrentDirectory
CurrentDirectory = objFSO.GetAbsolutePathName(".")
outFile=CurrentDirectory & "\SyncNow.txt"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write “TP” 'T for temperature, P for pressure
objFile.Close

'Wait with completing the script until the file is not existing anymore, then it’s save to continue our imaging run
do while(objFSO.FileExists(outFile))
WScript.Sleep 1000 ‘sleep for 1 seconds
Loop
’------------------------------------

which execute normally when double cliked on it is not lanched when using sgp pre or post event.
the phd log states sgp run the script but this is not effective…

**

EDIT found by myself : the script should not be stored in a directory containing spaces ("\document and settings" for example…)

**


#2

What version of SGP are you running? I thought this had been addressed.

Thanks,
Jared


#3

2.4 beta at home and tested as well today on 2.3
same behavior…
maybe a regional glich ?


#4

I found with my VBS scripts that they had to be in the directory that is called for in the “Target Data” section of your sequence dialog. This holds true for 2.4.x beta also. Actually I ran a sequence last night collecting some Lum data on M109, after that the next event was Flat collection and that triggers a VBS script that sends my CGE-Pro to the Flat taking position and turns off the drive. This worked perfectly last night. :smiley:


#5

Out testing uses scripts outside of this directory so I’m not sure about that.

Dies this mean that you got your script to work? One thing I noticed is that you are using wscript, calls whereas SGPro only supports cscript.


#6

Ken, I had the VBS issue a long time ago and you guys most likely fixed it along the way. I just kept the scripts in the same spot and have been a happy camper since. Did not even think of moving them again.


#7

Nop the script works with sgp 2.3 only, and on an xp computer , and not the other computer (wich is seven with the beta 2.4)
I suspect space glich is not the only problem right now. more later maybe…
I’m not aware about cscript/wscript diffrences since i’m not the present script writer.
what could be the form of a proper cscript ?
can someone test this script to see if it works properly ? (it should generate a .txt file in the same directory as the script.)


#8

Some news.
Modifying the scipt by simply tell it to launch a notepad make it works ok with sgp.
so sgp is not the problem here.
since the original script create a file, and that the script runs ok under win xp
i think this is a problem of permission or semething like that under seven.

So seems not a problem with sgp.

still searching for a solution.


#9

So:
I found that the problem was related to the part of the script defining the absolute path for writting the file.
The workaround is to hard code the path in the script : so the script become now :smile:

Set objFSO=CreateObject(“Scripting.FileSystemObject”)

'Create a file that triggers MountWeather to update the Mount

Set objFile = objFSO.CreateTextFile(“D:\MountWeather\SyncNow.txt”,True)
objFile.Write “TP” 'T for temperature, P for pressure
objFile.Close

'Wait with completing the script until the file is not existing anymore, then it’s save to continue our imaging run
do while(objFSO.FileExists(outFile))
WScript.Sleep 1000 'sleep for 1 seconds
Loop

regards,


#10

Good catch. This is a bug in SGPro. Event scripts now support paths with spaces…


#11

Right, is it a solved bug or will it be solved in a future release ?

thanks


#12

Solved. It will be in the next 2.4 Release.


www.mainsequencesoftware.com