Git Product home page Git Product logo

Comments (2)

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

if "VD examples.ahk" works fine, then you got it
VD.ahk was not meant to be ran, it was meant to be #Included by other scripts

because I can't, I need you to tell me
what should the README.md have included ? so that when you saw it, you wouldn't have had this confusion

Spoiler warning, click here to see more After you thought about it

would adding something like this work? :

VD.ahk will crash/close immediately, run "VD examples.ahk"

I just realized, you could have been misled by "no dependencies"
were you misled by "no dependencies" ?

My Attempt at Explaining

why are there 2 files VD.ahk and VD examples.ahk ?

say you have a project "app manager.ahk" that needs Virtual Desktop Capabilities,
you #Include VD.ahk into "app manager.ahk", then you have Virtual Desktop Capabilities (in code, this means VD methods)

"VD examples.ahk" is an example of such project: it #Includes VD.ahk, then it is able to call VD methods
like when you press Numpad2, it will call VD.goToDesktopNum(2)

numpad2::VD.goToDesktopNum(2)

you can say that VD.ahk is a class, or a library, or functions,
that said, VD.ahk and VD examples.ahk CAN be merged into 1 file,
but this would cause problems for people who want to use this script in their other scripts
read: pmb6tz/windows-desktop-switcher#47


why does VD.ahk close immediately ?

well, the program finished everything it had to do, so it exited
VD.ahk has no hotkeys, no code to run, it was done doing everything it had to do, so it exited

whilst "VD examples.ahk" does stuff : when you press a hotkey, it will do stuff

from vd.ahk.

4nur4g avatar 4nur4g commented on July 27, 2024

Thanks for the detailed explanation. Here's what went through my mind when I downloaded your script for personal use:

Seeing the file's name, "VD examples.ahk" gave an impression as if it's a demo file. The message box on launch further validated my assumption. It had detailed actions that one could do with the script.

Such instructions are generally put inside the "Read me" file. And then, the script just works after launch. One need not be greeted with documentation every time the script is launched.

I thought "VD examples.ahk" is the demo file and "VD.ahk" is the main script for the reasons mentioned above. Or in other words, I assumed: "VD.ahk" = "VD examples.ahk" - (Message box having a brief documentation)

I get that we can remove the message box by manually editing the concerned part of the script. However, users generally want the script to work without modifications.

Words of caution: I'm not a software engineer. I'm an ordinary man who thinks using common sense. Perhaps's it's the reason I misunderstood a seemingly obvious part.

Thanks again!
With Appreciation
Anurag

from vd.ahk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.