跳至主要內容

應用程式選擇器

「應用程式選擇器」提供了一個應用程式預覽清單,提供了允許使用者選擇一個或多個應用程式的能力。

類型為 app 的「單個應用程式選擇器」只允許使用者勾選一個應用程式,其回傳值為 字串,是使用者所選應用程式的 Bundle ID。

而類型為 apps 的「多個應用程式選擇器」允許使用者拖選多個應用程式並為其排序,其回傳值為 包含字串的陣列,是使用者所選應用程式 Bundle ID 的有序集合。

範例

local group, name

group = 'App'
name = 'app.bundle_path(bid)'

return {
name = string.format('%s - %s', group, name),
description = "获取 App 的应用程序包路径",
arguments = {
{type = 'app'},
},
default = "com.darwindev.XXTExplorer", -- 默認選中的應用 Bundle ID
generator = function(bid)
return string.format('app.bundle_path(%q)', bid)
end,
}

IMG_0005.PNG

IMG_0006.PNG