It is currently February 27th, 2021, 10:04 pm

ActiveDock

Skins to open folders and launch applications and websites
User avatar
jsmorley
Developer
Posts: 21551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

ActiveDock

Post by jsmorley »

User avatar
XANCI
Posts: 104
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: ActiveDock

Post by XANCI »

figure out a way to use lua to get exe's name

in skin:

Code: Select all

[Variables]
Path="C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Exe=

[ms]
Measure=Script
ScriptFile="#CURRENTPATH#Process.lua"

[mp]
Measure=Plugin
Plugin=Plugins\Process.dll
ProcessName=#Exe#.exe
in Lua:

Code: Select all

function Update()
  sPath=tostring(SKIN:GetVariable("Path"))
  sExe=tostring(SKIN:GetVariable("Exe"))
  sEP=string.match(sPath,"(.*)\.exe")
  if type(sEP)=="nil" then
    sEN=""
  else
    sEN=string.gsub(sEP,".*%\\","")
  end
  if sExe~=sEN then
    SKIN:Bang("!WriteKeyValue Variables Exe \""..sEN.."\"")
    SKIN:Bang("!Refresh")
  end
end
User avatar
jsmorley
Developer
Posts: 21551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ActiveDock

Post by jsmorley »

Nice work... ;-)
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: ActiveDock

Post by santa_ryan »

If you want a real example (though crudely done) of what XANXI said, my Total Control! suite has a dock that does this x12.
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.
User avatar
XANCI
Posts: 104
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: ActiveDock

Post by XANCI »

made a little modification incase some programs use a launcher exe, which different from the actual process
use "ExeOverride=" to set actual process, leave blank if you don't need to override

in skin:

Code: Select all

[Variables]
Path="C:\Program Files (x86)\Internet Explorer\iexplore.exe"
Exe=
ExeOverride=

[ms]
Measure=Script
ScriptFile="#CURRENTPATH#Process.lua"

[mp]
Measure=Plugin
Plugin=Plugins\Process.dll
ProcessName=#Exe#.exe
in Lua:

Code: Select all

function Update()
  sPath=tostring(SKIN:GetVariable("Path"))
  sExe=tostring(SKIN:GetVariable("Exe"))
  sEO=tostring(SKIN:GetVariable("ExeOverride"))
  if sEO=="" then
    sEP=string.match(sPath,"(.*)\.exe")
    if type(sEP)=="nil" then
      sEN=""
    else
      sEN=string.gsub(sEP,".*%\\","")
    end
  else
    sEN=sEO
  end
  if sExe~=sEN then
    SKIN:Bang("!WriteKeyValue Variables Exe \""..sEN.."\"")
    SKIN:Bang("!Refresh")
  end
end
User avatar
jsmorley
Developer
Posts: 21551
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ActiveDock

Post by jsmorley »

Link in first post changed to a new version that works with the new Release Candidate version of Rainmeter 2.2.