Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

321
Views
¿Cómo difundir una variable en AutoHotkey?

En JavaScript, usamos el operador de propagación para distribuir una serie de elementos, por ejemplo

 const arr = [1, 2, 3] console.log(...arr) // 1 2 3

Y quiero lograr un efecto similar en AHK:

 Position := [A_ScreenWidth / 2, A_ScreenHeight] MouseMove Position ; 👈 how to spread it?
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

AFAIK, no hay sintaxis extendida en AHK, pero hay algunas alternativas:

Para arreglos grandes puedes usar:

 position := [A_ScreenWidth / 2, A_ScreenHeight] Loop,% position.Count() MsgBox % position[A_Index] ; show a message box with the content of any value

o

 position := [A_ScreenWidth / 2, A_ScreenHeight] For index, value in position MsgBox % value ; show a message box with the content of any value

En tu ejemplo, puede ser:

 position := [A_ScreenWidth / 2, A_ScreenHeight] MouseMove, position[1], position[2]

Esto moverá el mouse a la mitad inferior de la pantalla.

Para evitar decimales, puede usar las funciones Floor() , Round() , Ceil() por ejemplo, como:

 position := [ Floor( A_ScreenWidth / 2 ), Round( A_ScreenHeight ) ] Loop,% position.Count() MsgBox % position[A_Index] ; show a message box with the content of any value
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!