| View previous topic :: View next topic |
| Author |
Message |
V1P3R
Joined: 26 Sep 2006 Posts: 15
|
Posted: Tue Sep 26, 2006 6:57 pm Post subject: 2 questions from a newbie |
|
|
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 |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5890
|
Posted: Tue Sep 26, 2006 7:03 pm Post subject: Re: 2 questions from a newbie |
|
|
| V1P3R wrote: | | 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? |
| Code: | StringLeft, Todate, A_Now, 8
EnvAdd, Todate, 1, D
FormatTime, nDate, %Todate%, dd.MM.yyyy
msgBox, % ndate |
Regards,  _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Sep 26, 2006 7:14 pm Post subject: |
|
|
| Quote: | | 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 ).
As you proclaim to be new I've done it for you (only because I remembered that similar request from - guess when - today )
[Next day of the week's 3-letter A_DDD]
Kinda coincidence isn't it? ...
| Quote: | | Is it possible, to generate an arranged output from an Excel Row on the clipboard? | Yes.
| Quote: | | Is such thing possible within AutoHotkey boundaries? | Yes.
Show us some code and we'll check it out ...  |
|
| Back to top |
|
 |
V1P3R
Joined: 26 Sep 2006 Posts: 15
|
Posted: Tue Sep 26, 2006 7:46 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Tue Sep 26, 2006 7:52 pm Post subject: |
|
|
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!
Am I'm right that you haven't checked AHK's help already?
ClipBoard/Sort/Variables/... ? |
|
| Back to top |
|
 |
V1P3R
Joined: 26 Sep 2006 Posts: 15
|
Posted: Tue Sep 26, 2006 9:49 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Sep 27, 2006 10:44 am Post subject: |
|
|
| V1P3R wrote: | | 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. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
V1P3R
Joined: 26 Sep 2006 Posts: 15
|
Posted: Wed Sep 27, 2006 1:02 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Sep 27, 2006 1:16 pm Post subject: |
|
|
OK, I took a look, and the separator is actually Tab, so it is OK.
Example:
| Code: | Send ^c
Sleep 50
selection := Clipboard
StringSplit cells, selection, %A_Tab%
MsgBox %cells5% / %cells2% / %cells4%
|
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5890
|
Posted: Wed Sep 27, 2006 1:42 pm Post subject: |
|
|
| PhiLho wrote: | | OK, I took a look, and the separator is actually Tab, so it is OK. |
I did not guess it! .. Regards,  _________________ SKAN - Suresh Kumar A N |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed Sep 27, 2006 1:54 pm Post subject: |
|
|
No need to guess, I just looked at the formats with CLCL's clipboard viewer...  _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
V1P3R
Joined: 26 Sep 2006 Posts: 15
|
Posted: Wed Sep 27, 2006 2:12 pm Post subject: |
|
|
PhiLho: OMFG thanks! Thats EXACTLY what I was looking for! You just made my daily routine much easier. Everlasting graditude!
V1P3R |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Sep 27, 2006 11:51 pm Post subject: |
|
|
| Code: | 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: FKW / HVW2KPDM3 / PDM3
Send ^c
Sleep 50
selection := Clipboard
StringSplit cells, selection, %A_Space% ; or %A_Tab% ???
Line = %cells19% / %cells15% / %cells12%
StringUpper, Line, Line
MsgBox % Line |
|
|
| Back to top |
|
 |
adamisageek
Joined: 05 Mar 2007 Posts: 20 Location: Erie, PA
|
Posted: Thu Mar 27, 2008 8:12 pm Post subject: |
|
|
| PhiLho wrote: | Just try:
Send ^c
Sleep 50
MsgBox %Clipboard% |
| Philho wrote: | OK, I took a look, and the separator is actually Tab, so it is OK.
Example:
| Code: | Send ^c
Sleep 50
selection := Clipboard
StringSplit cells, selection, %A_Tab%
MsgBox %cells5% / %cells2% / %cells4% |
|
| BoBo wrote: | | Code: | clipboard =
Send ^c
Sleep 50
selection := Clipboard |
|
cough...don't you guys mean this?
| Code: | 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.  _________________ My AutoHotKey.com username has changed to GeekyAdam |
|
| Back to top |
|
 |
|