Jump to content
Sign in to follow this  
ForsakenGod

ClipPut

Recommended Posts

ForsakenGod

Hello,

I would like to ask when somethink is putted into clip in a format

ClipPut( $part1 & " ColorUP-" & $part2 & " ColorDown-" & $part3 & " Buy-" & $part4 & " Sell-" & $part5 & " Nakup/Predaj-" & $part6 & " Ok-" & $part7)

So the actual think in clip is

Coord- coor1,coor2,coor3,coor4 ColorUP-Color1 ColorDown-Color2 etc etc

I woud like to read from clip and set theese Coor 1 Coor2 etc to different inputboxxes so its automated after a press of button is that possiblee I ve looked into the Help file but didnt find anythink .

Thank you for you time

Share this post


Link to post
Share on other sites
ForsakenGod

Anyone ? :)

Edited by ForsakenGod

Share this post


Link to post
Share on other sites
water

It's possible :)

You want to assign a string that you get from the clipboard to multiple variables. So you have to split the string. You need a separator so the StringSplit function knows where to split. Is this the comma or the dash in your case?

To make it easier you could separate the variables with @CRLF before writing it to the clipboard. Its easier to separate them again.

Why do you write to the clipboard at all? Is the information needed by a different program?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
ForsakenGod

It's possible :)

You want to assign a string that you get from the clipboard to multiple variables. So you have to split the string. You need a separator so the StringSplit function knows where to split. Is this the comma or the dash in your case?

To make it easier you could separate the variables with @CRLF before writing it to the clipboard. Its easier to separate them again.

Why do you write to the clipboard at all? Is the information needed by a different program?

Yes barely its needdet by a different programm . Could you Show me an example code ?

For example output of clipput is

Coords-1247,69,1547,73 how to split it up ? ;)

Edited by ForsakenGod

Share this post


Link to post
Share on other sites
water

Something like this:

#include <array.au3>
$sCoords = "Coords-1247,69,1547,73"
$aSplit = StringSplit($sCoords,",")
$aSplit[1] = StringMid($aSplit[1],8)
_ArrayDisplay($aSplit)
It assumes that "Coords-" is a literal and can be removed. The values are separated by ",".

As a result you get an array with the number of elements in $aSplit[0].


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Hi,

could you please try this skript:

#include <array.au3>
$sString = "Coords 0,0,10,70 ColorUP-15791353 ColorDown-255 Buy-105,63 Sell-28,57 Nakup/Predaj-903,705 Ok-783,562"

$aSplit1 = StringSplit($sString," ")

$aSplit2 = StringSplit($aSplit1[2],",")

$Input1 = $aSplit2[1]
$Input2 = $aSplit2[2]
$Input3 = $aSplit2[3]
$Input4 = $aSplit2[4]

$aSplit2 = StringSplit($aSplit1[3],"-")
$PrvaFarba = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[4],"-")
$DruhaFarba = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[5],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$BuyCoor1 = $aSplit2[1]
$BuyCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[6],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$SellCoor1 = $aSplit2[1]
$SellCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[7],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$OkPressCoor1 = $aSplit2[1] 
$OkPressCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[8],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$OkPressCoor3 = $aSplit2[1] 
$OkPressCoor4 = $aSplit2[2]

ConsoleWrite($Input1 & @CRLF & $Input2 & @CRLF & $Input3 & @CRLF & $Input4 & @CRLF & $PrvaFarba & @CRLF & $DruhaFarba & @CRLF & $BuyCoor1 & @CRLF & $BuyCoor2 & @CRLF & $SellCoor1 & @CRLF & $SellCoor2 & @CRLF & $OkPressCoor1 & @CRLF & $OkPressCoor2 & @CRLF & $OkPressCoor3 & @CRLF & $OkPressCoor4 & @CRLF)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
ForsakenGod

Hi,

could you please try this skript:

#include <array.au3>
$sString = "Coords 0,0,10,70 ColorUP-15791353 ColorDown-255 Buy-105,63 Sell-28,57 Nakup/Predaj-903,705 Ok-783,562"

$aSplit1 = StringSplit($sString," ")

$aSplit2 = StringSplit($aSplit1[2],",")

$Input1 = $aSplit2[1]
$Input2 = $aSplit2[2]
$Input3 = $aSplit2[3]
$Input4 = $aSplit2[4]

$aSplit2 = StringSplit($aSplit1[3],"-")
$PrvaFarba = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[4],"-")
$DruhaFarba = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[5],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$BuyCoor1 = $aSplit2[1]
$BuyCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[6],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$SellCoor1 = $aSplit2[1]
$SellCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[7],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$OkPressCoor1 = $aSplit2[1] 
$OkPressCoor2 = $aSplit2[2]

$aSplit2 = StringSplit($aSplit1[8],"-")
$aSplit2 = StringSplit($aSplit2[2],",")
$OkPressCoor3 = $aSplit2[1] 
$OkPressCoor4 = $aSplit2[2]

ConsoleWrite($Input1 & @CRLF & $Input2 & @CRLF & $Input3 & @CRLF & $Input4 & @CRLF & $PrvaFarba & @CRLF & $DruhaFarba & @CRLF & $BuyCoor1 & @CRLF & $BuyCoor2 & @CRLF & $SellCoor1 & @CRLF & $SellCoor2 & @CRLF & $OkPressCoor1 & @CRLF & $OkPressCoor2 & @CRLF & $OkPressCoor3 & @CRLF & $OkPressCoor4 & @CRLF)

WOW ! Big thanks really really really thank you thanksss ! Works perfect :) thank youuu ! B) Now i can finally move on ! ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×