Hi Kael,
Sorry for the delay.
I finally found a solution wich maybe could help the comunity. This solution is not as simple as I expected but works fine.
This is what i have done :
1. get the script object present in your model (A), especially the script text.
2. concat the script text with the following script (B)
|
Dim CurrentObject, Dictionary
Sub Main()
On Error Resume Next
Set Studio = CreateObject("Studio.Editor")
Set Projects = CreateObject("OMTE.Projects")
if Err.Number > 0 then
Studio.DisplayOutputWindowMessage Err.Description & " " & Err.Source & vbcrlf
Err.Clear
end if
On Error Resume Next
Call Studio.OpenModel("%_PROJ_NAME_%")
modRef = Studio.GetCurrentModelReference()
Set Project = Projects.Item("Reference", modRef)
Set CurrentObject = Project.ItemByID("%_PKG_ID_%")
Set Dictionary = CurrentObject.Item("Dictionary")
if Err.Number > 0 then
Studio.DisplayOutputWindowMessage Err.Description & " " & Err.Source & vbcrlf
Err.Clear
else
if RunUtilityUI then
Project("Transaction") = "Begin"
On Error Resume Next
CommitUtility
if Err.Number > 0 then
Project("Transaction") = "Abort"
else
Project("Transaction") = "Commit"
end if
end if
end if
End Sub
Call Main()
|
This script open the model in wich the modification should be done, call the utilityUI method of the retreive script text.
3. Once the concatenation is done, save it into a temporary vbscript file.
4. Create a process wich execute the CSCript exe, and execute the temporary script previously created.
5. Finally, observe the modifications.
This method is a complex one but allow to execute a given script from outside of a model.
Hope this could help.
Regards