답: SMTP보다 https://community.jmp.com/t5/Discussions/Bug-or-Feature/mp/673679#M86115 .
작동하면 스크립트 창이 항상 열려 있습니다. 실패하면 창이 열리지 않으며 JMP는 스크립트 끝에서 사라지는 임시 평가 컨텍스트를 사용합니다.
스크립트가 완료되도록 허용하기 전에 실행 프로그램이 완료될 때까지 기다리는 스크립트 끝에 루프를 사용하여 문제를 해결할 수도 있습니다. runprogram이 백그라운드에서 작동하는 동안 다른 JSL이나 플랫폼을 실행하려는 경우에는 작동하지 않지만 대략 다음과 같습니다.
RP=runprogram(...);
while(1,
// check the message names, there might be another one you need too
if(RP<<CANREAD></CANREAD>
그런 식으로 평가 컨텍스트는 runprogram이 완료될 때까지 유지됩니다.
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;
);
)
)
);
도움을 주셔서 감사합니다!
자동화 및 스크립팅