<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: I want to use a script to close the page below, how to write this script in Moldflow Insight Forum</title>
    <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12834089#M459</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15603421"&gt;@1292909313&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;BR /&gt;First, if changes has been made to study, it should be saved.&lt;BR /&gt;Otherwise a dialog will appear "Save changes to study_name?".&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Set StudyDoc = Synergy.StudyDoc()
StudyDoc.Save&lt;/LI-CODE&gt;&lt;P&gt;Might need to add a wait for save to complet such as:&lt;BR /&gt;WScript.Sleep 3000 '* in ms, so a wait of 3s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are using Autodesk Moldflow Insight 2021.1 , and to close the window:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;'* Closes all windows with title
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")

'* You are using Autodesk Moldflow Insight 2021.1
oShell.Run "taskkill /fi ""WINDOWTITLE eq Autodesk Moldflow Insight 2021.1""",0,False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Berndt&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2024 08:02:51 GMT</pubDate>
    <dc:creator>bernor_mf</dc:creator>
    <dc:date>2024-06-12T08:02:51Z</dc:date>
    <item>
      <title>I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833724#M456</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1292909313_0-1718163011456.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1374726i3C08A2089AAD6A5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="1292909313_0-1718163011456.png" alt="1292909313_0-1718163011456.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 03:30:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833724#M456</guid>
      <dc:creator>1292909313</dc:creator>
      <dc:date>2024-06-12T03:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833790#M457</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15603421"&gt;@1292909313&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If understand you correctly, you want to close the study.&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;This example closes the active study.&lt;BR /&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;SetLocale("en-us")
Dim SynergyGetter, Synergy
On Error Resume Next
Set SynergyGetter = GetObject(CreateObject("WScript.Shell").ExpandEnvironmentStrings("%SAInstance%"))
On Error GoTo 0
If (Not IsEmpty(SynergyGetter)) Then
	Set Synergy = SynergyGetter.GetSASynergy
Else
	Set Synergy = CreateObject("synergy.Synergy")
End If
Synergy.SetUnits "Metric"

Set StudyDoc = Synergy.StudyDoc()
StudyDoc.Close&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If to close more open studies, you need to loop the command.&lt;/P&gt;&lt;P&gt;If you get an error, it means no study open, and you need error handling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Berndt&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 04:52:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833790#M457</guid>
      <dc:creator>bernor_mf</dc:creator>
      <dc:date>2024-06-12T04:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833919#M458</link>
      <description>&lt;P&gt;Sorry, I want to close this window&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 06:29:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12833919#M458</guid>
      <dc:creator>1292909313</dc:creator>
      <dc:date>2024-06-12T06:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12834089#M459</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15603421"&gt;@1292909313&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;BR /&gt;First, if changes has been made to study, it should be saved.&lt;BR /&gt;Otherwise a dialog will appear "Save changes to study_name?".&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Set StudyDoc = Synergy.StudyDoc()
StudyDoc.Save&lt;/LI-CODE&gt;&lt;P&gt;Might need to add a wait for save to complet such as:&lt;BR /&gt;WScript.Sleep 3000 '* in ms, so a wait of 3s&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are using Autodesk Moldflow Insight 2021.1 , and to close the window:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;'* Closes all windows with title
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")

'* You are using Autodesk Moldflow Insight 2021.1
oShell.Run "taskkill /fi ""WINDOWTITLE eq Autodesk Moldflow Insight 2021.1""",0,False&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Berndt&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 08:02:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12834089#M459</guid>
      <dc:creator>bernor_mf</dc:creator>
      <dc:date>2024-06-12T08:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12834288#M460</link>
      <description>&lt;P&gt;Thank you very much, my problem has been solved&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 09:43:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12834288#M460</guid>
      <dc:creator>1292909313</dc:creator>
      <dc:date>2024-06-12T09:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: I want to use a script to close the page below, how to write this script</title>
      <link>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12836458#M461</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/15603421"&gt;@1292909313&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for the feedback.&lt;/P&gt;&lt;P&gt;Happy to hear your issue were solved.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Berndt&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 04:50:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/moldflow-insight-forum/i-want-to-use-a-script-to-close-the-page-below-how-to-write-this/m-p/12836458#M461</guid>
      <dc:creator>bernor_mf</dc:creator>
      <dc:date>2024-06-13T04:50:42Z</dc:date>
    </item>
  </channel>
</rss>

