Tag: 苹果

recursion的Excel电子表格input到Applescript iMessage / SMS Messaging

好的,今天第一次和Applescript玩,6-7小时后几乎是在那里。 这个脚本的基本前提是,它应该从Excel电子表格中读取两列数据,一列是电话号码,另一列是警报。 然后它将消息写入iMessage / SMS并发送。 我已经从CSV工作,现在尝试使用源Excel文件绕过转换步骤。 我遇到了一个经典的数字格式问题,它将数字读入科学记数法并扰乱了电话号码。 把它转换回正常的stringiMessage似乎扼杀格式。 (在这一点上,我知道它简单的东西我错过了。) set phoneCol to "O" set messageCol to "P" set startRow to 3 set endRow to 5 set xlsFilePath to (path to desktop as text) & "test.xlsx" tell application "Microsoft Excel" to open file xlsFilePath repeat with thisRow from startRow to endRow tell application "Microsoft Excel" set […]

如何使用Applescript从Excel工作表填充页面文件

我正尝试从Excel电子表格中的数据填充模板。 这是我第一次进入Applescript。 我的计划是在模板中有唯一的文本string(即Value_1,Value_2等),然后将每个值存储在一个variables中,并查找和replace每个string的每个variables。 我非常感谢任何帮助; 这里是我在哪里: tell application "Microsoft Excel" tell active workbook activate object worksheet "Page 2" copy range range "B7" of active sheet // Store as variable? end tell end tell tell application "Pages" activate tell application "System Events" keystroke "v" using command down // Find and replace? end tell end tell

AppleScript从Excel工作表中获取活动单元格的值

尝试从Excel工作表中获取当前突出显示的单元格的值 set x to null tell application "Microsoft Excel" tell worksheet "Sheet1" of active workbook set x to value of active cell as string display dialog x end tell end tell 以上AppleScript将x设置为“缺失值”。 我在这里做错了什么,有没有其他的方式来获得活动单元格的价值? 我正在使用MAC版本14.0.0的Microsoft Excel 2011

Applescript / Excel我想失去小数的答案

我正在编写一个applescript来处理XML的电子表格,而且几乎已经完成了,但是我发现只要它从一个单元格中检索到这个值,并且这个值是一个数字,就会用十进制格式化它。 4变成4.0 我怎样才能强制它只获得整个号码? 数字不是唯一的价值。 以下是相关的代码: — Copy field from SS tell application "Microsoft Excel" activate goto reference cellNum set GotValue to value of active cell as string delay 0.3 –tell application "System Events" to keystroke "c" using command down delay 2 end tell 而且我知道我可以通过一个限定和保留小数点前的第一部分的函数来处理它,但正如我所说的,比数字更多的东西通过这个,段落也可以。 所以这不会很好。

使用Applescript在Excel中删除行

我想在使用苹果脚本的Excel中删除特定的行。 我想根据给定列中的值删除行。 在给定的列中,我有一个我想要保留的值列表(例如3001,3004,5003等)。 例如,如果我的任何值(3001,3004,5003)在列CI中都想保留包含该值的行。 如果该行不包含我列中的某个值,则想要删除该行。 我在这里find了这个applescript,但它所做的只是删除了第2行中的所有内容,我无法得到它来保留我的值范围。 因为我正在处理C列,所以我将字段10replace为字段3,并且将“(不是NY状态)”改为“(不是3001)”,但是这并不起作用。 另外我该如何列出这些值,我列出它们是“(3001,3004,5003)”还是“(3001; 3004; 5003)”还是什么? tell application "Microsoft Excel" set autofilter mode of active sheet to false set lastRow to first row index of last row of used range autofilter range row ("1:" & lastRow) field 10 criteria1 "(Not NY State)" select row ("2:" & lastRow) delete selection — if […]

Applescript只执行一半我的代码

我有两个简单的代码片段来编写Excel脚本,一个获取其他集合。 如果我把它们放在不同的脚本中,它们就像广告一样工作。 如果我将它合并到一个脚本中,则只执行第一个“Microsoft Excel”代码块。 当我有一个邮件代码块后面跟着一个更复杂的脚本中的Excel代码块时,我注意到这一点,有时第二个告诉应用程序块不运行(日志语句不会logging等)。 并不总是,但这足以让我发疯。 这里发生了什么?! 其实第二个问题,这个日志语句不会返回任何东西到脚本事件窗口,我怎么有时看到日志,有时不会。 tell application "Microsoft Excel" tell active sheet tell range "A1:B3" return value log ("Running") end tell end tell end tell tell application "Microsoft Excel" tell active sheet tell range "A1:B3" set value to {{11, 12}, {21, 22}, {31, 32}} end tell end tell end tell 这是看似相同的问题的第二个例子: tell […]

AppleScript&Excel:根据variables设置范围

我是一个AppleScript新手,几乎完成了一个脚本来获取电子表格,并将其格式化为一个FileMaker数据库。 这个电子表格是捐助者的月度报表,我只想从中提取捐款。 在捐赠logging下面,我需要删除一些导入列中的一些会计信息,以便干净地导入数据。 这里是完整的脚本: tell application "Microsoft Excel" activate set theWorkbook to open workbook workbook file name "File Path" –Open the file that contains the DonorId for all Donors set theWorkbook to open workbook workbook file name "File Path" –Open the Monthly Transaction Report set myrange_1 to range ("A1:E4") delete myrange_1 tell worksheet "Transaction Report" […]

如何使用AppleScript引用已命名的Excel列?

想象一下,你有一个名为Customers.xlsx的Excel 2010电子表格(这很容易,如果你的尝试)。 您有一个名为Customers的工作表。 电子表格数据如下所示: CustomerId Name Email ———- ——– ————— 1001 Ken ken@gmail.com 2001 Jennifer jen@gmail.com 3001 Violet violet@gmail.com 我有一个简单的AppleScript,简单地循环这些数据,并显示每一行的对话框。 set strExcelFileLocation to "Macintosh HD:Users:lowken:Documets:ExcelTest:Customers.xlsx" set strWorkSheetName to "Customers" set intCnt to 2 set intCustomerIdIndex to 1 set intNameIndex to 2 set intEmailIndex to 3 tell application "Microsoft Excel" activate –open workbook workbook file name […]

编写用于删除单元格中具有特定值的行的Apple脚本

我想删除Excel中的单元格与一定的值。 我已经走得很远,已经写了我自己的剧本借用一些互联网摘录。 set theOutputPath to (path to desktop folder as string) & "FilteredNY.csv" set fstring to "(Not NY State)" tell application "Microsoft Excel" activate open workbook workbook yatta yatta activate object worksheet 1 –>activate range current region set LastRow to ((count of rows of used range of active sheet) + 1) set lastCol to count […]

Applescript不会打开Excel 2011工作簿

有人可以告诉我下面的苹果有什么问题吗? set sourceFile to (choose file with prompt "Choose source files" of type {"XLS6", "XLS7", "XLS8", "XLS", "TXT"} with multiple selections allowed without invisibles) tell application "Microsoft Excel" — activate open workbook workbook file name sourceFile end tell 我收到以下错误 error "Microsoft Excel got an error: Can't continue open workbook." number -1708 如果我硬编码一个单独的文件path,脚本的工作原理,所以问题必须在设置sourceFile行,但我需要能够select一个文件,因为它不会总是相同的。