你好,
我有一些不同的脚本运行来监视来自不同表的不同数据。
所有图表都保存为C:\ Customer \ Data下的GIF文件。
我想为每个幻灯片创建一个带有一个GIF文件的ppt,标题幻灯片= Gif文件名。
下面的脚本工作正常,只能创建一个只有3个GIF的ppt。
NewReport= new window("New report",
V List Box(
Outline box(
"Gif1",
Picture Box( Open("C:\Customer\Data\Gif1.gif", gif ));
),
Outline box(
"Gif2",
Picture Box( Open("C:\Customer\Data\Gif2.gif", gif ));
),
Outline box(
"Gif3",
Picture Box( Open("C:\Customer\Data\Gif3.gif", gif ));
),
););
NewReport << Save Presentation( "C:\Customer\Report\NewReport.pptx", Insert(2), "GIF" );
我修改了下面的脚本来添加数据文件夹中的所有Gif文件,但它不起作用。
mypath =("C:\Customer\Data\");
FileName = Files in Directory(mypath);
NewReport= new window("New report",
V List Box(
For (i=1, i<=N items(FileName), i++,
Outline box(
""||FileName[i]||"",
Picture Box( Open("C:\Customer\Data\"||FileName[i]||"", gif )),
),
);
););
NewReport << Save Presentation( "C:\Customer\Report\NewReport.pptx", Insert(2), "GIF" );
谢谢你的帮助
杰夫
我真的不能在没有实际尝试的情况下编写脚本 - 所以我在Mac上使用JMP来模拟你的情况 - 所以这会有所不同,但我认为你可以翻译成Windows。
current_directory = convert file path (".");
FileName = Files in Directory (Current_directory||"Pictures");
OB_Expr = Expr(
Outline Box( "" || dv_FileName || "", Picture Box( Open( current_directory||"pictures/" || dv_FileName || "", jpg ) ), )
);
NewReport = New Window( "New report" );
For( i = 1, i <= N Items( FileName ), i++,
NewReport << append( eval(Substitute( Name Expr( OB_Expr ), Expr( dv_filename ), FileName[i] ) ))
);
NewReport << Save Presentation( "C:\Customer\Report\NewReport.pptx", Insert( 2 ), "GIF" );
Geoff - 首先 - 你在剧本中有一些额外的逗号,不需要 - 但我不确定这是否是一个问题。
只是看着这个 - 我设置了这样的新窗口:
NewReport = New Window( "New report");
把循环放在自己的上面并使用append - 就像这样
NewReport << Append ( Picture Box( Open( "C:\Customer\Data\" || FileName[i] || "", gif ) )
现在,它缺少了OutlineBox - 所以你必须通过使用Expr()来适应它。- 你熟悉吗?
如果你愿意,我可以为你写点什么。