This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 Change file Path with Gesture
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

3di

Germany
26 Posts

Posted - 01/26/2017 :  06:53:13  Show Profile
Hi Guys,

i tried to generate a new Gesture that changes a copied file Path.

Structure S
S:\Folder1\Folder2\Folder3
to:
P:\Structure1\Structure2\Folder1\Folder2\Folder3

So as you see i want S+ to change S:\ into P:\Structure1\Structure2
I tried the following:

acSendKeys("^c")
acDelay(50)
local clip = acGetClipboardText()
local parse = #clip
string.gsub(parse,"S:\"," P:\Structure1\Structure2\")
clip = clip:sub(1, parse)
acSetClipboardText(clip)

Unfortunately it doesn’t work – any suggestions.

Thanks in advance – keep up the good work.

Regards 3di

Rob

USA
2615 Posts

Posted - 01/26/2017 :  08:57:07  Show Profile  Visit Rob's Homepage
To be honest, I don't do much with gsub, etc. However, this snippet seems to work for me:
local clip = "S:\\Test\\Folder\\File.txt"
s = string.gsub(clip,"S:\\"," P:\\Structure1\\Structure2\\")
acMessageBox(s)
Though I'm not sure if that's too simple based on your specific requirements.
Go to Top of Page

3di

Germany
26 Posts

Posted - 01/30/2017 :  07:49:14  Show Profile
Hi Rob,

Nice to see you here and thanks for your assistance - as you could see in my suggestion i thought in a to complex way :-).

This is my final Solution

local clip = acGetClipboardText()
s = string.gsub(clip,"S:\\"," P:\\Structure1\\Structure2\\")
acSetClipboardText(s)
acDisplayText("Clipboard - Paste to S", "Calibri", 30, 192, 192, 192, 1500, gex,gey)
acSendKeys("^v")
acSendKeys("{ENTER}")

Thanks for your help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000