html批量转换ppt,Applescript - 批量转换PPT到HTML

我的编码知识是有限的。我正在尝试使用applescript和Keynote将PPT转换为HTML的过程自动化。在这种page我发现下面的非工作的苹果脚本:Applescript - 批量转换PPT到HTML

-- THE DESTINATION FOLDER

-- (see the "path" to command in the Standard Additions dictionary for other locations, such as pictures folder, movies folder, sites folder, desktop folder)

set the defaultDestinationFolder to (path to documents folder)

tell application "Keynote"

activate

try

if playing is true then tell the front document to stop

if not (exists document 1) then error number -128

-- DERIVE NAME FOR NEW FOLDER FROM NAME OF THE FRONT DOCUMENT

set documentName to the name of the front document

if documentName ends with ".key" then ¬

set documentName to text 1 thru -5 of documentName

-- CREATE AN EXPORT DESTINATION FOLDER

-- IMPORTANT: IT’S ADVISED TO ALWAYS CREATE A NEW DESTINATION FOLDER, AS THE CONTENTS OF ANY TARGETED FOLDER WILL BE OVERWRITTEN

tell application "Finder"

set newFolderName to documentName

set incrementIndex to 1

repeat until not (exists folder newFolderName of defaultDestinationFolder)

set newFolderName to documentName & "-" & (incrementIndex as string)

set incrementIndex to incrementIndex + 1

end repeat

set the targetFolder to ¬

make new folder at defaultDestinationFolder with properties ¬

{name:newFolderName}

set the targetFolderHFSPath to targetFolder as string

end tell

-- EXPORT THE DOCUMENT

with timeout of 1200 seconds

export front document as HTML to file targetFolderHFSPath

end timeout

on error errorMessage number errorNumber

display alert "EXPORT PROBLEM" message errorMessage

error number -128

end try

end tell

-- OPEN THE DESTINATION FOLDER

tell application "Finder"

open the targetFolder

end tell

-- VIEW THE PRESENTATION

tell application "Safari"

activate

open file (targetFolderHFSPath & "index.html")

end tell

我正在寻找一种方式来解决这个问题。目前,我得到以下结果:

error "Keynote got an error: No user interaction allowed." number -1713

2015-02-17

Maikol88

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值