FORUMS

Tasker "List File" does not work

74 posts
Thanks Meter: 3
 
By casper1, Member on 6th February 2020, 07:47 AM
Post Reply Email Thread
Please help. I don't understand why this doesn't work.

Files (156)
A1: List Files [ Dir:Download Match:testfile.pdf Include Hidden Files:eek:ff Use Root:eek:ff Sort Select:Alphabetic Variable:%filelistpath ]
A2: Flash [ Text:%filelistpath Long:eek:ff ]
6th February 2020, 08:28 AM |#2  
OP Member
Thanks Meter: 3
 
More
Files (156)
A1: List Files [ Dir:Download Match:testfile.pdf Include Hidden Files: Off Use Root: Off Sort Select:Alphabetic Variable:%filelistpath ]
A2: Flash [ Text:%filelistpath Long: Off ]
6th February 2020, 01:30 PM |#3  
ktmom's Avatar
Forum Moderator
Flag Deep Space Station K7
Thanks Meter: 3,197
 
More
The result, which is stored in your %filelistpath variable, is a Tasker array.

If you flash %filelistpath() you will get a comma separated list of all results.

If you flash %filelistpath(#) you will get the number of files found.

If you flash %filelistpath(1) or %filelistpath(2), you will get the 1st or 2nd array value.

There is more on accessing and managing arrays in the Tasker Userguidr. Arrays are discussed nearly at the end of the linked page.
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
6th February 2020, 03:38 PM |#4  
OP Member
Thanks Meter: 3
 
More
But the problem is the variable/array has no value, it's not even set. I'm sure the directory there has file.

Can't understand why
6th February 2020, 08:49 PM |#5  
ktmom's Avatar
Forum Moderator
Flag Deep Space Station K7
Thanks Meter: 3,197
 
More
Quote:
Originally Posted by casper1

But the problem is the variable/array has no value, it's not even set. I'm sure the directory there has file.

Can't understand why

It won't show anything without formatting the resulting variable as I described above. A variable that is an array, that is called without minimally the (), will display only the %variable as though it's not set. This is expected behavior.
The Following User Says Thank You to ktmom For This Useful Post: [ View ] Gift ktmom Ad-Free
7th February 2020, 03:13 AM |#6  
OP Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by ktmom

It won't show anything without formatting the resulting variable as I described above. A variable that is an array, that is called without minimally the (), will display only the %variable as though it's not set. This is expected behavior.


Ahhh, thank you very very much. This had been bothering me... Thanks thanks
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes