【问题标题】:Applescript Read File line by lineApplescript 逐行读取文件
【发布时间】:2015-05-23 07:42:25
【问题描述】:

我想制作一个读取文本文件的applescript,并将每一行的文本复制到剪贴板(我已经从这里排序),然后再移动到下一行并将其复制到剪贴板.谢谢!

【问题讨论】:

    标签: applescript


    【解决方案1】:
    # Determine the input file's path.
    set srcFile to ((path to desktop) as text) & "myFile.txt"
    
    # Read lines from file.
    set lns to paragraphs of (read file srcFile as «class utf8»)
    
    # Loop over lines read and copy each to the clipboard.
    repeat with ln in lns
        set the clipboard to ln
        display alert (the clipboard)
    end repeat
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-06-21
      • 2012-06-13
      • 2016-11-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多