类型 函数 返回值 无 版本 2024.3703 版 关键字 setAllowedTypes、Pasteboard 另请参阅 Pasteboard
设置粘贴时应用会接受的文件类型。例如,如果你只想让应用粘贴字符串,则只将 "string" 包含在 allowedTypes 表中。
pasteboard.setAllowedTypes( allowedTypes ) pasteboard.setAllowedTypes( nil )
表格。包含以逗号分隔的数据类型列表,应用会接受这些数据类型以执行粘贴操作。有效选项包括 "image"、"string" 和 "url"。你也可以传递 nil 以禁用所有粘贴操作。
local pasteboard = require( "plugin.pasteboard" )
-- Set the data types this application allows for a paste action
pasteboard.setAllowedTypes( { "string", "url", "image" } )