Jump to content

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

2 questions: Tomorrow's date & output from Excel



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

I just started using this program, awesome work guys. But I have 2 questions.

1. I can't seem to be able to do a SendInput for tomorrows date. It works with the YYYYMMDD format, but I can't seem to figure out, how to output tomorrows date in DD.MM.YY format, using EvntAdd, FormatTime. Please could you provide the lines for this?
2. Is it possible, to generate an arranged output from an Excel Row on the clipboard? I'll be more specific:
Lets say, i have an Excel Row in my clipboard.
A1 B1 C1 D1
_______________
12 as 34 xy
And I want a script to generate me the following output:

as / 34 / xy / 12
So basically the contents of the cells B1,C1,D1 and A1 in this order, seperated by a slash. Is such thing possible within AutoHotkey boundaries?

Your help is much apprechiated!

Bye!

V1P3R

[Title edited. Please write descriptive titles for your topics. ~jaco0646]

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

1. I can't seem to be able to do a SendInput for tomorrows date. It works with the YYYYMMDD format, but I can't seem to figure out, how to output tomorrows date in DD.MM.YY format, using EvntAdd, FormatTime. Please could you provide the lines for this?


StringLeft, Todate, A_Now, 8
EnvAdd, Todate, 1, D
FormatTime, nDate, %Todate%, dd.MM.yyyy
msgBox, % ndate

Regards, :)
kWo4Lk1.png

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

Please could you provide the lines for this?

Sorry, no. I expect you to search the forum in the first instance (even if Goyyah has already written some code for you :shock:).
As you proclaim to be new I've done it for you (only because I remembered that similar request from - guess when - today :roll:)
[Next day of the week's 3-letter A_DDD]
Kinda coincidence isn't it? ...

Is it possible, to generate an arranged output from an Excel Row on the clipboard?

Yes.

Is such thing possible within AutoHotkey boundaries?

Yes.
Show us some code and we'll check it out ... :wink:

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
THNX loads!

Starting to figure out how this all works.
But the 2nd problem is still beyond me.

Concerning this:
http://trackid.uw.hu/work.xls

So this is basically one of the Excel Sheets (its more complex, but if we solve this, I can implement it further) I have to work with.
I need to search through all these fields, and output a line like this manually, many times durring a workday:
LOC / LS / SID / SYN
So in row 2 its:
FKW / EU / SA01 / P60
Its just too tedious, but I figured, with a script, that can handle clipboards and shortcuts, it would be possible, to select a line,
copy it to the clipboard, and with a shortcut, generate the needed output.

Is it clear now?

BoBo
  • Guests
  • Last active:
  • Joined: --
The word 'output' implies that it should be used somewhere else afterwards ... don't be shy, tell us the whole truth. I guess we can stand it! :wink:

Am I'm right that you haven't checked AHK's help already?
ClipBoard/Sort/Variables/... ?

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
With output I mean I only need the given sorted Excel row in SetInput for usage in another program.
I think the Excel Sheet I attached quite clearly shows what I need.
And sorry, I could not find anything related to sorting Excel Cells on the AutoHotkey site.
The problem is that the sorting option is not numeric, nor alphabetic, the delimiting characters are not present, and I don't know what Excel uses as a delimiter if I copy a whole row from Excel to the clipboard.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005

I don't know what Excel uses as a delimiter if I copy a whole row from Excel to the clipboard.

Just try:
Send ^c
Sleep 50
MsgBox %Clipboard%

with Excel opened and the right cells selected, of course.
Actually, Excel will flood the clipboard with many formats, AutoHotkey will try and get a textual one.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
Thats clear. But how to order the output?

I have:
170 GSD GSP PDM/GSP 0950-015-08-04 PDM/GSP WEBServer 1 Maintenance & Infrastructure PDM3 Prod DB hvw2kpdm3 164.137.46.160 1 F FKW Windows 2000

I need:
FKW / HVW2KPDM3 / PDM3

Text contains spaces - so i can't use them to determine which column is which.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
✓  Best Answer
OK, I took a look, and the separator is actually Tab, so it is OK.
Example:
Send ^c
Sleep 50
selection := Clipboard
StringSplit cells, selection, %A_Tab%
MsgBox %cells5% / %cells2% / %cells4%

Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

OK, I took a look, and the separator is actually Tab, so it is OK.


:shock: I did not guess it! .. Regards, :)
kWo4Lk1.png

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
No need to guess, I just looked at the formats with CLCL's clipboard viewer... :-)
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

V1P3R
  • Members
  • 28 posts
  • Last active: Jun 19 2018 12:13 PM
  • Joined: 26 Sep 2006
PhiLho: OMFG thanks! Thats EXACTLY what I was looking for! You just made my daily routine much easier. Everlasting graditude!

V1P3R

BoBo
  • Guests
  • Last active:
  • Joined: --
Clipboard = 170 GSD GSP PDM/GSP 0950-015-08-04 PDM/GSP WEBServer 1 Maintenance & Infrastructure PDM3 Prod DB hvw2kpdm3 164.137.46.160 1 F FKW Windows 2000 



; I need: [color=red]FKW / HVW2KPDM3 / PDM3[/color]



Send ^c 

Sleep 50 

selection := Clipboard 

StringSplit cells, selection, %A_Space% ; or %A_Tab% ???

Line = %cells19% / %cells15% / %cells12%

[color=red]StringUpper[/color], Line, Line

MsgBox % Line


adamisageek
  • Members
  • 20 posts
  • Last active: May 07 2008 07:59 PM
  • Joined: 05 Mar 2007

Just try:
Send ^c
Sleep 50
MsgBox %Clipboard%

OK, I took a look, and the separator is actually Tab, so it is OK.
Example:

Send ^c
Sleep 50
selection := Clipboard
StringSplit cells, selection, %A_Tab%
MsgBox %cells5% / %cells2% / %cells4%

clipboard =
Send ^c
Sleep 50
selection := Clipboard

cough...don't you guys mean this?
Send^c
ClipWait
selection := clipboard
msgbox %selection%
The built in sleep function will wait x amount of time and then continue, whereas the built in ClipWait funtion will wait until the clipboard contains something, which is more precise.
just tryin to help. :D
My AutoHotKey.com username has changed to GeekyAdam