Salut à tous
Après avoir examiné quelques discussions sur la fonction XPATH et utilisé l'aide de JMP JSL est sorti avec le script ci-dessous.
Je voulais partager ce script pour faire passer le graphique du graphique de variabilité au dossier du bureau sous forme de fichier PNG.
Cela aide vraiment lors de la rédaction d'un rapport avec des graphiques multiples.
Le paramètre principal et critique pour que cela fonctionne sur une autre plate-forme est le nombre qui est utilisé pour diviser la fonction «xpath» et la fonction f (i) correspondante à la fonction Outlinebox.
Dans ce cas, le diviseur xpath était = 2.
f (i) = 2 * i-1.
//-------------------------
Clear Log();
Names Default To Here( 1 );
while( 1,
If( Is Directory( "$DESKTOP/Graph" ) == 0,
//if no directory -> create folder and display Message
rc = Create Directory( "$DESKTOP/Graph" );
//copy graphs
for( i = 1, i <= N Items( Current Report() << XPath( "//OutlineBox" ) ) / 2, i++,
Current Report()[Outline Box( 2 * i - 1 )] << Save Picture(
"$DESKTOP/Graph/Graph" || Char( i ) || ".PNG", "PNG"
);
Wait( 0.001 );
);
//display Message
New Window( "Message",
modal,
H List Box(
Spacer Box( size( 5, 0 ) ),
Text Box( "All graphs are saved at new folder at Desktop/Graph" )
)
);
//if there is directory -> check if empty if no break if yes continue
,
if( N Items( Files In Directory( "$DESKTOP/Graph" ) ) > 0,
New Window( "Message",
modal,
H List Box( Spacer Box( size( 5, 0 ) ), Text Box( "Please empty folder DESKTOP/Graph" ) )
);
Break();
,
//copy graphs
for( i = 1, i <= N Items( Current Report() << XPath( "//OutlineBox" ) ) / 2, i++,
Current Report()[Outline Box( 2 * i - 1 )] << Save Picture(
"$DESKTOP/Graph/Graph" || Char( i ) || ".PNG", "PNG"
);
Wait( 0.001 );
);
//display Message
New Window( "Message",
modal,
H List Box(
Spacer Box( size( 5, 0 ) ),
Text Box( "All graphs are saved at new folder at Desktop/Graph" )
)
);
)
);
Break();
);
//-------------------------