topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday November 8, 2024, 8:23 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: appcap and appcapresults not working for .ahk files  (Read 5177 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
appcap and appcapresults not working for .ahk files
« on: September 12, 2022, 06:11 AM »
appcap and appcapresults do not work for AutoHotkey .ahk files, but they work if we compile the same script to .exe

To reproduce this issue:
1. Save this script as C:\folder\a.ahk
Code: Text [Select]
  1. FileAppend, C:\Windows\System32\mspaint.exe, * ;StdOut
2. right click .ahk and compile, to get a.exe
2. Create new FARR alias
alias name: appcaptest
alias results:
Code: Text [Select]
  1. .ahk test | appcapresults C:\folder\a.ahk
  2. .exe test | appcapresults C:\folder\a.exe
3. try both alias results

Expected effect: both alias results should transform the result list to a link to Paint
Actual effect: ".ahk test" does nothing

This issue has existed for a long time (maybe since appcap was first introduced?) but would be nice to see it fixed (if possible and easy) or to see if anyone knows a workaround on the AutoHotkey side, without compiling the script that is. Mouser, does appcap try to use any file passed to it (and the issue is rather something in Windows) or is there a whitelist in FARR based on extensions or something else?
« Last Edit: September 12, 2022, 11:58 AM by Nod5 »

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: appcap and appcapresults not working for .ahk files
« Reply #1 on: September 28, 2022, 08:32 AM »
Hello Nod5,

Have u tried something like :
appcapresults "C:\Program Files\AutoHotkey\AutoHotkey.exe" C:\folder\a.ahk


Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: appcap and appcapresults not working for .ahk files
« Reply #2 on: September 28, 2022, 03:37 PM »
appcapresults "C:\Program Files\AutoHotkey\AutoHotkey.exe" C:\folder\a.ahk
Thank you, that indeed works! For repeat use we can shorten it by adding a user variable to FARR settings
ahk=C:\Program Files\AutoHotkey\AutoHotkey.exe
and then use this alias result line
appcapresult "%uservar.ahk%" C:\folder\a.ahk

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: appcap and appcapresults not working for .ahk files
« Reply #3 on: September 28, 2022, 03:50 PM »
BTW @mouser it seems chaining setfocus after the appcapresults or fileresults commands doesn't work. For example neither of these
appcapresults "C:\Program Files\AutoHotkey\AutoHotkey.exe" C:\folder\a.ahk ;;; setfocus mainpanel
fileresults C:\folder\a.txt ;;; sleep 1000 ;;; setfocus mainpanel
gets focus to the imported results list.
It would be useful to have focus at the first results list item in this case.