get 4th item in folder path

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sbrady19
Posts: 338
Joined: 12 Apr 2018, 05:22
Location: Central Florida
Contact:

get 4th item in folder path

Post by sbrady19 » 18 Aug 2022, 10:11

here is the path to an open folder.

\\server.xxx.local\Features1\ATP\ATP197 Beggarly, Rusty\EXPORTS

I need to extract item 4: ATP197 Beggarly, Rusty

how do i do this. Thanks.

sbrady19
Posts: 338
Joined: 12 Apr 2018, 05:22
Location: Central Florida
Contact:

Re: get 4th item in folder path

Post by sbrady19 » 18 Aug 2022, 10:16

I got this to work

Code: Select all

{
	StringSplit, word, clipboard , \
	{
	Audio_Folder = \\%word3%\%word4%\%word5%\%word6%\Nuendo Project\%word6% NPR\Audio
	merge_folder = \\%word3%\%word4%\%word5%\%word6%\Nuendo Project\%word6% NPR\Audio\merge
	}
}
msgbox %merge_folder%

User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: get 4th item in folder path

Post by mikeyww » 18 Aug 2022, 10:20

Or:

Code: Select all

Clipboard = \\server.xxx.local\Features1\ATP\ATP197 Beggarly, Rusty\EXPORTS
Sleep, 100
; ------------------------
b := "\", word := StrSplit(Trim(Clipboard, b), b)
MsgBox, 64, Fourth item, % word.4
merge_folder := b b word.2 b word.3 b word.4 b word.5 "\Nuendo Project\" word.5 "\NPR\Audio\merge"
MsgBox, 64, Merge folder, %merge_folder%

Post Reply

Return to “Ask for Help (v1)”