Need help to copy a date

Hi, i want to copy the year “2019” and +1 year to it and put it in the same position. I have tried copy text activity but it doesn’t work. Is there any other way to do it?

Can you successfully use Get Text to get the entire string from the box?

@Anthony_Humphries I keep getting error using the get text activity. And the year is not consistent, it can be 2009, 2020, 2019 or other years.

Hi.
Did you try changing String to int32?

@jhj3627 Yup, but the copy selected text activity shows error when i run the file

Maybe I think the problem is that the File name has ‘.’.
It can occur the extension error.
How about change the name like AAAAA 2019/05/31?

Is not my file so I can’t change the date format

@lala Can you use the Get Attribute Activity and indicate the Field that you want and Open the Selector in UiExplorer and Send that Screenshot here ?

Hi @supermanPunch


image

@lala Can you Indicate Element again and check if you are able to get a Selector ?

@lala Doesn’t seem like there is an Attribute that could get you the Value inside the field, usually there will be aaname or innertext attributes to get the values from inside the fields.

Is there any other way?

@lala Can you indicate File name: Label and Check it’s Selectors ?

There is no selector in the file name

@lala Have you tried using Get Text Activity with the Selector that you have got with Get Attribute. If that doesn’t work, we might need to use Hot Keys and Clipboard Activities

Hi @lala,

You probably need to refine the selector, try to navigate in the application tree (left panel) and find a reliable selector manually, if it’s possible with the aaname or innertext attribute as @supermanPunch mentionned it.

It could be a little tricky and take a little time but sometimes it’s necessary with legacy apps. Try to create an arborecence in the selector with several lines (kind of html/div/div/span/p for an HTML example)

2 Likes

@supermanPunch @vdarold
My sequence is using hotkey to move to the left and select the whole year (ctrl + shift + left), then I tried using copy selected text (int32) and assign activity + 1 (int32) to the variable “Year”, and delete the 2019 and I used type into activity as Year.ToString, but it says the copy selected text have one or more error.
The assign + 1 is so that the 2019 can add 1 year and become 2020.

@lala Instead of using the Hotkey to move to the Left, you can just use Ctrl + A to select all the text, then use Copy Selected Text Activity to get the Text and then Extract the Date Part in it, Convert it into Integer using Cint , Increment the year, Convert to String, Replace the Old year with new year and use Set To ClipBoard with the New value. Then use Send Hot Key Ctrl +A, another Hotkey Ctrl + V to paste the new value in it.

This seems a lot of work to do :sweat_smile: , and hence this should be considered as the last method that you would want to use. If other methods are able to get you the value, you should use that.

1 Like

I did the Cint but still the copy selected text activity show 1 or more error occurred