Hi @ikenassi ,
I've done some digging in your macros and I haven't found where there is an answer to the OP question. Probably I don't understand your macros well enough yet. Could you point me to where you do this?
I currently have 21 desktop spaces and would like more. I have not figured out a way, using just KM and AppleScript, without relying on a third-party app, to identify which space I'm in, when a space is moved/rearranged, etc.
I've been using a third-party app called CurrentKey, but it is no longer supported. It was free, but the developer was unable to keep it updated so that it could stay in the App Store, he's now a father, and various factors contributed to it being withdrawn. If you contact him on Twitter, he has been willing to put it in the App Store for 24 hours on request, but that is not a solution that I can recommend to others. His system works by placing an invisible app on each desktop. Activating any specific invisible window of that app switches desktops. Seeing which window is foremost tells him which desktop you are in. Etc.
But I haven't yet figured out how to achieve the same thing using only KM and AppleScript. I believe it "should" be possible, but it's currently below my skill level.
If you think your Desktop Images can help, I would appreciate pointers to the appropriate places. Can you, for instance, determine what image is the background on the current desktop? If every desktop had different wallpaper, that might give useful information.