split Code to more than one line?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 913
Joined: 29 Sep 2013, 22:18

split Code to more than one line?

18 May 2014, 22:45

Any suggestions for how to make a filecopy with very long paths more legible. I tried splitting the line at a comma but then the filecopy didn't work. I suppose I could use variables, one for source and the other for target but that takes more lines. VBA allows the user to split at a _. Nothing similar in autohotkey? Thanks
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: split Code to more than one line?

18 May 2014, 22:55

thanks for clarifying VB. i always wondered about "_" used in this case:

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: split Code to more than one line?

18 May 2014, 23:15

?

Code: Select all

FileCopy
, C:\SomeFilePath\SomeFile.ext
, C:\OtherFilePath
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: split Code to more than one line?

19 May 2014, 00:11

how do you split this long path:

Code: Select all

FileCopy
, C:\SomeFilePath1\SomeFilePath2\SomeFilePath3\SomeFilePath4\SomeFilePath5\SomeFilePath6\SomeFilePath7\SomeFilePath8\SomeFilePath9\SomeFilePath10\SomeFilePath11\SomeFilePath12\SomeFilePath13\SomeFilePath14\SomeFilePath15\SomeFile.ext
, C:\OtherFilePath
User avatar
PuzzledGreatly
Posts: 913
Joined: 29 Sep 2013, 22:18

Re: split Code to more than one line?

19 May 2014, 01:18

Can anyone confirm if splitting a line with a comma works with filecopy as when I tried it it didn't work for me. Thanks
kon
Posts: 1756
Joined: 29 Sep 2013, 17:11

Re: split Code to more than one line?

19 May 2014, 02:04

The above code worked for me. Perhaps post the code you have tried.
HotKeyIt
Posts: 2144
Joined: 29 Sep 2013, 18:35
Contact:

Re: split Code to more than one line?

19 May 2014, 06:57

Code: Select all

FileCopy,% "
(Join
C:\SomeFilePath1\SomeFilePath2\SomeFilePath3\SomeFilePath4
\SomeFilePath5\SomeFilePath6\SomeFilePath7\SomeFilePath8\SomeFilePath9
\SomeFilePath10\SomeFilePath11\SomeFilePath12\SomeFilePath13\SomeFilePath14
\SomeFilePath15\SomeFile.ext
)", C:\OtherFilePath
Hamlet
Posts: 32
Joined: 02 Oct 2013, 09:55
Location: Seoul, Korea

Re: split Code to more than one line?

19 May 2014, 07:18

We call it Expressions.
Enjoy !!

Code: Select all

FileCopy
, 	% "C:\"
.	"SomeFilePath1\"
.	"SomeFilePath2\"
.	"SomeFilePath3\"
.	"SomeFilePath4\"
.	"SomeFilePath5\"
.	"SomeFilePath6\"
.	"SomeFilePath7\"
.	"SomeFilePath8\"
.	"SomeFilePath9\"
.	"SomeFile.ext"	
, 	% "C:\"
.	"SomeFilePath9\"
.	"SomeFilePath8\"
.	"SomeFilePath7\"
.	"SomeFilePath6\"
.	"SomeFilePath5\"
.	"SomeFilePath4\"
.	"SomeFilePath3\"
.	"SomeFilePath2\"
.	"SomeFilePath1\"
.	"SomeFile.ext"	
or We can call it Concatenate operators.
kiwichick
Posts: 94
Joined: 21 Jan 2014, 22:03

Re: split Code to more than one line?

25 May 2014, 18:24

PuzzledGreatly wrote:I tried splitting the line at a comma but then the filecopy didn't work.
Yeah I've tried using the comma too. With one script it worked and yet with another it didn't. The Help documentation doesn't say anything about there being scenarios where it won't work so I'd like to know why it didn't.
Hamlet
Posts: 32
Joined: 02 Oct 2013, 09:55
Location: Seoul, Korea

Re: split Code to more than one line?

25 May 2014, 20:37

kiwichick wrote:
PuzzledGreatly wrote:I tried splitting the line at a comma but then the filecopy didn't work.
Yeah I've tried using the comma too. With one script it worked and yet with another it didn't. The Help documentation doesn't say anything about there being scenarios where it won't work so I'd like to know why it didn't.
What's your scenarios, specifically ?

The help file is just a man-made one. It's not perfect at all. More importantly it is free of charge. If possible, your help will be very valuable for the better Help file.
kiwichick
Posts: 94
Joined: 21 Jan 2014, 22:03

Re: split Code to more than one line?

25 May 2014, 22:48

Hamlet wrote:What's your scenarios, specifically ?

The help file is just a man-made one. It's not perfect at all. More importantly it is free of charge. If possible, your help will be very valuable for the better Help file.
Thanks Hamlet, Unfortunately I can't remember what script it was but if I come across the issue again I'll definitely post back here :-)

Return to “Ask For Help”

Who is online

Users browsing this forum: scriptor2016, songdg and 35 guests