Get string from recently downloaded in chrome

I have downloaded a pdf. It gets stored in “C\downloads”. It should take recently downloaded pdf only and get the data from it


This is my flow.
But I’m getting an error on assign - “Visualbasic’I’”.

Please help. Thankyou

@BHUSHAN_NAGAONKAR1

use if Activity and pass the output of Path Exists and in the then block use

Read pdf text activity or Extract pdf text activity and pass the file path not output of path exists

Ok, But what about the error above on the assign how should I fix it?

Thanks

I tried to pass the path in it but I’m getting Iresourcelocal error

@BHUSHAN_NAGAONKAR1

Directory.GetFiles(“”,“*.pdf”,SearchOption.AllDirectories).OrderByDescending

Use read pdf text activity

1 Like

Hi @BHUSHAN_NAGAONKAR1 ,

Check double quotes here. Try typing it manually: “*.pdf”

Hope its works you

Regards,
Vinit Mhatre

1 Like

Directory.GetFiles("","*.pdf",SearchOption.AllDirectories).OrderByDescending(Function(a) new FileInfo(a).CreationTime)

1 Like

Hi @BHUSHAN_NAGAONKAR1

Visual Basic error means your double quotes aren’t right. Please Re-type your Double quotes, this should solve the error.

Directory.GetFiles(path, "*.pdf").OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToArray()

Regards

1 Like

Hi @BHUSHAN_NAGAONKAR1 ,

Use below expression

Directory.GetFiles("download folder path", "*.pdf").OrderByDescending(Function(file) New FileInfo(file).LastWriteTime).FirstOrDefault()

Regards,
Vinit Mhatre

1 Like

It worked, how can I pass the path to extract pdf and extract string.

Hi @BHUSHAN_NAGAONKAR1 ,

You can store Full PDF path into assign activity

Regards

1 Like

And I have to share that path to “Extract Pdf Text” Activity?

LocalResource.FromPath(arrstr.First)

@BHUSHAN_NAGAONKAR1

1 Like

Hi @BHUSHAN_NAGAONKAR1 ,

Yes just pass your variable as below

Regards,
Vinit Mhatre

@BHUSHAN_NAGAONKAR1

You need to pass the arrayvariable.first

in both the activities in Path exists and Extract PDF text activity

1 Like

This worked thankyou.
Thankyou for your time and help

1 Like

@Shiva_Nikhil Thankyou for your help and prompt response.

1 Like

Happy Automation !!

Regards,
Vinit Mhatre

1 Like