#Display the first Final Cut Pro Keyword Shortcut Value
-- Create a new Canvas:local v = hs.canvas.new{x =0, y =0, w =90, h =90}-- Add a black background:
v[1]={
frame ={ h ="100%", w ="100%", x =0, y =0},
fillColor ={ alpha =1, red =0, green =0, blue =0},
type ="rectangle",}-- Write the first Keyword from the FCPX Preferences file:local keywords = cp.apple.finalcutpro.preferences.FFKeywordGroups
local keywordOne = keywords and keywords[1]and keywords[1][1]or""
v[2]={
frame ={ h ="100%", w ="100%", x =0, y =0},
text ="\n\n".. keywordOne,
textAlignment ="center",
textColor ={ white =1.0},
textSize =15,
type ="text",}-- Convert the Canvas into an icon:local icon = v:imageFromCanvas()-- Delete the Canvas:
v:delete()-- Return the icon:return icon
-- Create a new Canvas:local v = hs.canvas.new{x =0, y =0, w =90, h =90}-- Add a black background:
v[1]={
frame ={ h ="100%", w ="100%", x =0, y =0},
fillColor ={ alpha =1, red =0, green =0, blue =0},
type ="rectangle",}-- Write the current Spotify Track as text:
v[2]={
frame ={ h ="100%", w ="100%", x =0, y =0},
text ="\n\n".. hs.spotify.getCurrentTrack(),
textAlignment ="center",
textColor ={ white =1.0},
textSize =15,
type ="text",}-- Convert the Canvas into an icon:local icon = v:imageFromCanvas()-- Delete the Canvas:
v:delete()-- Return the icon:return icon
-- Create a new Canvas:local v = hs.canvas.new{x =0, y =0, w =90, h =90}-- Add a black background:
v[1]={
frame ={ h ="100%", w ="100%", x =0, y =0},
fillColor ={ alpha =1, red =0, green =0, blue =0},
type ="rectangle",}-- Write the System Volume as text:
v[2]={
frame ={ h ="100%", w ="100%", x =0, y =0},
text ="\n\n".. hs.audiodevice.defaultOutputDevice():outputVolume(),
textAlignment ="center",
textColor ={ white =1.0},
textSize =15,
type ="text",}-- Convert the Canvas into an icon:local icon = v:imageFromCanvas()-- Delete the Canvas:
v:delete()-- Return the icon:return icon