【问题标题】:Apple Script that copies/pastes text is broken in Yosemite复制/粘贴文本的 Apple Script 在 Yosemite 中被破坏
【发布时间】:2015-07-07 18:59:51
【问题描述】:

我制作了一个简单的 AppleScript,它从 Photoshop 中复制图层名称并将它们粘贴到 Illustrator 中。它在 Mountain Lion 中运行良好,但现在在 Yosemite 中无法正常运行。它重复了 6 次,但在第一次运行时似乎没有激活 Illustrator。它确实会激活其他 5 次重复的 Illustrator。这里是:

repeat 6 times
tell application "Adobe Photoshop CC 2014" to activate
tell application "System Events"
    tell process "Photoshop"
        keystroke "/" using command down
        keystroke "c" using command down
        keystroke tab
    end tell
end tell
delay 0.3
tell application "Adobe Illustrator" to activate
tell application "System Events"
    tell process "Illustrator"
        keystroke "v" using command down
        keystroke return
        keystroke "-"
        keystroke space
    end tell
end tell
end repeat
end

感谢您的帮助!

【问题讨论】:

    标签: macos applescript automator osx-yosemite


    【解决方案1】:
    tell application "System Events" to repeat 6 times
    
        tell process "Photoshop" to repeat until frontmost is true
            set frontmost to true
            delay 1
        end repeat
        keystroke "/" using command down
        keystroke "c" using command down
        keystroke tab
    
        tell process "Illustrator" to repeat until frontmost is true
            set frontmost to true
            delay 1
        end repeat
        keystroke "v" using command down
        keystroke return
        keystroke "-"
        keystroke space
    
    end repeat
    

    【讨论】:

      猜你喜欢
      • 2013-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多