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

发布于 2024-11-07 08:28:13 字数 268 浏览 0 评论 0原文

我有一个包含数百个成员的 .txt 格式列表(每行一个 memberID),我需要使用 Automator 将它们添加到 Web 应用程序中。

因此,txt 类似于:

30335842
30335843
30335844
...

我需要将其插入网页上,但我想这是最简单的部分,因为我可以使用自动化器创建操作。

只是不确定每次如何从文本文件中获取新的 id 以便与自动化工作流程一起使用。

非常感谢您的帮助。

I have a list of a few hundred members in .txt format (one memberID per line) and I need to add them to a web app using Automator.

So the txt is something like:

30335842
30335843
30335844
...

And I need to insert this on a web page, but I guess thats the easy part because I can create actions using automator.

Just not sure how to get new id from the text file each time to use with the automator workflow.

Many thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场信仰旅途 2024-11-14 08:28:13

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

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

It's easy, you basically read the file and put the results into a list. Then you can get the items in the list either referencing a list number directly...

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

or you can get at them all with a repeat loop...

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文