告诉 AppleScript 转到 Excel 中的特定窗口
我有一个脚本,可以从 Excel(Mac Excel'04) 电子表格中提取信息,并通过本地数据库对其进行处理。我的问题(这是暂时的,等待使用 Excel '08 的专用脚本机)是当我需要在 Excel 中处理另一个电子表格时。我想确保 AppleScript 继续从正确的电子表格中读取数据。
有没有办法在 AppleScript 中传递对特定 Excel 文件的引用,而不是仅仅告诉应用程序?或者可能只是引用电子表格而不必打开它......?
I've got a script that pulls information from an Excel(Mac Excel'04) spreadsheet, and processes it through a local database. My problem(which is temporary, pending a dedicated scripting machine w/ Excel '08) is when I need to work on another spreadsheet in Excel. I want to ensure that the AppleScript continues reading data from the correct spreadsheet.
Is there a way to pass reference to the specific Excel file in AppleScript, as opposed to just telling the Application in general? Or possibly just referencing the spreadsheet without having to have it open ... ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在一个单独的库中一次性定义了这个函数(以及许多其他函数)
将其另存为 ExcelLib.app 在“计算机脚本”文件夹中的“Common”文件夹
这一行:
中 在与 Excel 相关的每个 applescript 的开头,我添加了 当需要获取工作簿和工作表时,我只需使用以下方法:
然后每次您想要处理工作表的特定范围时,只需这样做:
或
I defined once for all in a separate lib this function (among many others)
Saved this as ExcelLib.app in a folder "Common" in "Computer Scripts" folder
In the beginning of each applescript related to Excel, I add this line :
And when comes the time to get the workbook and worksheet, I just use this :
Then each time you want to work on a specific range of the sheet, just do it this way :
or
如果我理解正确的话,您希望在处理另一个工作簿时启动一个适用于给定工作簿的脚本。
以下构造应该可以解决问题:
不幸的是,您无法处理“封闭”文档...
HTH
If I understand correctly, you wish to launch a script that works on a given workbook while you work on another.
the following construct should do the trick:
Unfortunately, you cannot work on "closed" documents...
HTH