如何解决ImageMagick - 要转换的批处理文件
我有一个脚本,可以以正确的纵横比将 PDF 转换为 JPG。
baz
我有两个问题:
-
是否可以创建一个批处理文件来对从 Internet 下载的输入文件 PDF 执行转换。类似于在'convert.bat'中打开,结果将是指定位置的JPG。
-
是否可以设置输出文件的变量名
解决方法
我能够创建一个批处理文件。我在下面补充。也许它会对某人有用。
function wa13477102() {
// set up the spreadsheet and establish the current sheet with a new tab named after the survey inquirer name
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet();
// get the name of the current sheet - so that you don't accidentally try and name the new sheet with the same name.
var oldName = sheet.getName();
// get the values from Cell B2 and C2
// Note for the date in Cell C2 we use "getDisplayValue()" for a WYSIWYG value.
var myday = sheet.getRange("C2").getDisplayValue();
// get the new name just by joining the two; there are lots of other ways to do this; you can search on Stackoverflow
var newName = myday;
// logic
// 1) if the length of the newname is grater than zero - that means there IS a value for newname; it's not just a blank.
// AND
// 2) the new name isn't the same as the old name.
if (newName.toString().length > 0 && newName !== oldName) {
// insert a new sheet and name it with your newname.
ss.insertSheet(newName);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。