Page 1 of 1

File.exists()

Posted: 14 Feb 2021, 16:49
by minx
The documentation for File does not mention .exists, but it is part of the File object as a function.

So this works:

Code: Select all

if (File.exists(filename)) {
    ...
}
Wondering if this is a stable feature as it is not documented.

There is a mention here, and the work has perhaps been done?

Code: Select all

actiona --version
Actiona 3.10.1, script 1.1.0

Re: File.exists()

Posted: 14 Feb 2021, 19:58
by eureka
It is interesting to explore Qt objects.

But because Qt4 objects are dated and it is difficult to hunt down the documentation I have started embedding python scripts into Top bar > Script > Resources. I can then use Command object to run python scripts almost as plugins. I pass variables between Python and Actiona through text file, read as variable by Actiona.

Actiona then becomes a container for such embedded resources .. scripts.

Your File.exists() task can then be scripted in Python code.

https://stackoverflow.com/questions/828 ... exceptions

This is a longer route than writing in Code but Python is well documented.

I have found other interesting cases for this hybrid approach. One such case is using Actiona to build connectors in a microservice architecture. I will write this up later in Ideas since it seems important to share.