Applescript 获取 GIF 文件位置,将其复制到剪贴板并粘贴
Applescript to grab a GIF file location, copy it to the clipboard, and pasting it
我正在尝试编写一个 apple 脚本来定位、复制和粘贴图像文件。
以下代码适用于 jpegs
和 pngs
:
set thePath to "file_location"
set the clipboard to (read thePath as «class PNGf») # [1]
tell application "System Events" to keystroke "v" using command down
当我将其更改为 GIF
格式时,它不起作用:
set thePath to "file_location"
set the clipboard to (read thePath as GIF picture) # [1]
tell application "System Events" to keystroke "v" using command down
相反,它抓取 GIF
的第一帧,而不是 整个 文件。
有人知道这里出了什么问题吗?
这适用于最新版本的 mac OS High Sierra。
set thePath to "/Library/Desktop Pictures/Abstract.jpg"
-- set the clipboard to a file (this only works with a single file or folder)
set the clipboard to POSIX file thePath
delay 1
tell application "System Events" to keystroke "v" using command down
我正在尝试编写一个 apple 脚本来定位、复制和粘贴图像文件。
以下代码适用于 jpegs
和 pngs
:
set thePath to "file_location"
set the clipboard to (read thePath as «class PNGf») # [1]
tell application "System Events" to keystroke "v" using command down
当我将其更改为 GIF
格式时,它不起作用:
set thePath to "file_location"
set the clipboard to (read thePath as GIF picture) # [1]
tell application "System Events" to keystroke "v" using command down
相反,它抓取 GIF
的第一帧,而不是 整个 文件。
有人知道这里出了什么问题吗?
这适用于最新版本的 mac OS High Sierra。
set thePath to "/Library/Desktop Pictures/Abstract.jpg"
-- set the clipboard to a file (this only works with a single file or folder)
set the clipboard to POSIX file thePath
delay 1
tell application "System Events" to keystroke "v" using command down