Macros 使用Automator/Applescript进行数据输入?

Macros 使用Automator/Applescript进行数据输入?,macros,applescript,automator,Macros,Applescript,Automator,我有一个几百个.txt格式的成员列表(每行一个memberID),我需要使用Automator将他们添加到web应用程序中 因此,txt类似于: 30335842 30335843 30335844 ... 我需要在网页上插入这个,但我想这很容易,因为我可以使用自动机创建动作 只是不确定每次如何从文本文件中获取新id以用于automator工作流 非常感谢您的帮助。这很简单,您基本上可以阅读文件并将结果放入列表中。然后,您可以获取列表中的项目,或者直接引用列表编号 set filePath t

我有一个几百个.txt格式的成员列表(每行一个memberID),我需要使用Automator将他们添加到web应用程序中

因此,txt类似于:

30335842
30335843
30335844
...
我需要在网页上插入这个,但我想这很容易,因为我可以使用自动机创建动作

只是不确定每次如何从文本文件中获取新id以用于automator工作流


非常感谢您的帮助。

这很简单,您基本上可以阅读文件并将结果放入列表中。然后,您可以获取列表中的项目,或者直接引用列表编号

set filePath to (path to desktop as text) & "memberID.txt" -- path to the file
set idsText to read file filePath -- get the file text
set idsList to paragraphs of idsText -- turn the text into a list

set nextID to item 2 of idsList
或者你可以通过一个重复的循环把它们都弄到手

set filePath to (path to desktop as text) & "memberID.txt" -- path to the file
set idsText to read file filePath -- get the file text
set idsList to paragraphs of idsText -- turn the text into a list

repeat with i from 1 to count of idsList
    display dialog (item i of idsList)
end repeat

这就是读取文件并获取成员ID的Applescript?但我还需要使用automator来使用获取的成员id执行操作,如何将两者结合起来?