Re:SMTP見るhttps://community.jmp.com/t5/Discussions/Bug-or-Feature/mp/673679#M86115 。
これが機能すると、スクリプト ウィンドウが常に開いた状態になります。 失敗するとウィンドウは開かず、JMP はスクリプトの最後で消える一時的な eval コンテキストを使用します。
おそらく、スクリプトの最後に、スクリプトの終了を許可する前に runprogram の終了を待機するループを使用して、この問題を回避できる可能性があります。 runprogram がバックグラウンドで動作している間に他の JSL またはプラットフォームを実行することが予想される場合、これは機能しませんが、おおよそ次のようになります。
RP=runprogram(...);
while(1,
// check the message names, there might be another one you need too
if(RP<<CANREAD></CANREAD>
そうすることで、runprogram が完了するまで eval コンテキストが保持されます。
RunProgram コンテキストが閉じられました - SMTPこんにちは、みんな、
SMTP サーバーからさまざまな人に添付ファイルを送信しようとしています。
スクリプトは正しく動作します。
唯一の問題は、スクリプトを直接実行するためにスクリプトの先頭に「!//」を追加すると、次のエラーが発生することです。

私が使用するスクリプトは次のとおりです。
//!
Names Default To Here( 1 );
// modifier le type de codage dans le PowerShell (windows)
stringCommand = "$OutputEncoding = [System.Text.Encoding]::UTF8";
// paramètres du mail à envoyer
commands = {
"Send-MailMessage -From '... -To '...' -Subject 'test' -Body 'test' -SmtpServer... -Attachment 'test...'",
"exit\!n"
};
// script exécution PowerShell
icommand = 0;
RP = Run Program(
Executable( "PowerShell.exe", stringCommand, ShowWindow("Hide") ),
ReadFunction( Function( {this}, Write( this << Read ) ) ),
WriteFunction(
Function( {this},
icommand++;
If( icommand <= N Items( commands ),
this << Write( commands[icommand] );
,
this << WriteEOF;
);
)
)
);
助けてくれてありがとう !
自動化とスクリプト作成