Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Script help needed



  • Please log in to reply
7 replies to this topic
V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
Hi guys,

Please help me with this

I have tried to make a script, which converts an excel row copied onto the clipboard into the format I want it.

::de::
Send 06:00{Tab}14:30{Tab}8{Tab}{Tab}{Tab}8{Tab}0{Enter}
Return

::du::
Send 13:30{Tab}22:00{Tab}8{Tab}{Tab}{Tab}2{Tab}6{Enter}
Return

::es::
Send 09:30{Tab}18:00{Tab}8{Tab}{Tab}{Tab}4{Tab}4{Enter}
Return

::n::
Send 08:00{Tab}16:30{Tab}8{Tab}{Tab}{Tab}6{Tab}2{Enter}
Return

::ej::
Send 22:00{Tab}06:00{Tab}8,5{Tab}{Tab}{Tab}0{Tab}8,5{Enter}
Return

::hn::
Send 06:00{Tab}18:00{Tab}12{Tab}{Tab}{Tab}0{Tab}12{Enter}
Return

::he::
Send 18:00{Tab}06:00{Tab}12{Tab}{Tab}{Tab}0{Tab}12{Enter}
Return

::11::
Send 11:30{Tab}20:00{Tab}8{Tab}{Tab}{Tab}2{Tab}6{Enter}
Return

::kmc::
Loop, parse, clipboard, %A_Tab%
{
Send %A_LoopField%
Send {Space}
}
Return

the excel row contains the given expressions (de, du, etc.)
The scipt does nothing.
I suspect, that by sending %A_LoopFiled% and a space after that, the scripts ::du:: etc. dont trigget.
How can I solve this?

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
what is on your clipboard when you run this?

I'm not sure one hotstring can trigger another...

try this:
de:
Send 06:00{Tab}14:30{Tab}8{Tab}{Tab}{Tab}8{Tab}0{Enter}
Return

du:
Send 13:30{Tab}22:00{Tab}8{Tab}{Tab}{Tab}2{Tab}6{Enter}
Return

es:
Send 09:30{Tab}18:00{Tab}8{Tab}{Tab}{Tab}4{Tab}4{Enter}
Return

n:
Send 08:00{Tab}16:30{Tab}8{Tab}{Tab}{Tab}6{Tab}2{Enter}
Return

ej:
Send 22:00{Tab}06:00{Tab}8,5{Tab}{Tab}{Tab}0{Tab}8,5{Enter}
Return

hn:
Send 06:00{Tab}18:00{Tab}12{Tab}{Tab}{Tab}0{Tab}12{Enter}
Return

he:
Send 18:00{Tab}06:00{Tab}12{Tab}{Tab}{Tab}0{Tab}12{Enter}
Return

11:
Send 11:30{Tab}20:00{Tab}8{Tab}{Tab}{Tab}2{Tab}6{Enter}
Return

::kmc::
Loop, parse, clipboard, %A_Tab%
{
Gosub %A_LoopField%
Send {Space}
}
Return


V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
That doesnt work :S

To be more clear, I have made an XLS shared on google.
Hope who can help me can view it
http://spreadsheets....770&hl=en&pli=1

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005

what is on your clipboard when you run this?

:?:

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
Copied from the XLS in the URL


From this line copied to the clipboard:
du 11:30 n


I want such an output:
13:30 22:00 8 2 6
11:30 20:00 8 2 6
8:00 16:30 8 6 2

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
The delimiters are tabs, as this is copied from, and the result will go into an excel file

Helpy
  • Guests
  • Last active:
  • Joined: --
✓  Best Answer
Hotstring doesn't seem like a good idea here.
I would try something like:
keys = de,du,es,n,ej,hn,he,11

de =  06:00`t14:30`t8`t`t`t8`t0`n
du =  13:30`t22:00`t8`t`t`t2`t6`n
es =  09:30`t18:00`t8`t`t`t4`t4`n
n =  08:00`t16:30`t8`t`t`t6`t2`n
ej =  22:00`t06:00`t8,5`t`t`t0`t8,5`n
hn =  06:00`t18:00`t12`t`t`t0`t12`n
he =  18:00`t06:00`t12`t`t`t0`t12`n
11 =  11:30`t20:00`t8`t`t`t2`t6`n

Loop Parse, Clipboard, %A_Tab%
{
	If A_LoopField in %keys%
	{
		sequence := %A_LoopField%
		Send %sequence%%A_Space%
	}
}
Return
associated to a hotkey.

BoBo¨
  • Guests
  • Last active:
  • Joined: --

Script help needed

Please be specific! There's no doubt that at a forum which supports a scripting language - at the 'Ask for Help' section (!) to point out explicitly that you need 'help on scripting'.
Thanks for listening. 8)