Page 1 of 2

GET FILE NAME FROM PB

PostPosted: Mon May 01, 2017 7:06 pm
by satanete666
Hi ,

I would like to know if is possibe to get from pandoras box the file names of each folder in your proyect, because we need to make a media control with labels in one proyect.

thanks in advance.

Re: GET FILE NAME FROM PB

PostPosted: Mon May 01, 2017 11:17 pm
by Benni_M
If you have folder and file Id's you can read the names of the files.

Cheers,
Benni

Re: GET FILE NAME FROM PB

PostPosted: Sat May 06, 2017 12:45 am
by satanete666
Can you give me the command or node to do that?

thanks in advance

Re: GET FILE NAME FROM PB

PostPosted: Sat May 06, 2017 2:37 pm
by Dennis Kuypers
Hello,

I added scripts for that to WD V6 recently. It's not in the 5002 RC, but it will be in the next release.

Regards
Dennis

Re: GET FILE NAME FROM PB

PostPosted: Sat May 06, 2017 4:53 pm
by Benni_M
Create a Grafik layer.
Set mute rendering.
In wd:
For 1 to 99
DeviceSetMedia,SiteID,DeviceID,FolderID,for.index
VGetDeviceMediaName,VarName,SiteID,DeviceID
Next

Cheers,
Benni

Re: GET FILE NAME FROM PB

PostPosted: Sat May 06, 2017 8:52 pm
by malkuth23
Clever solution.

Re: GET FILE NAME FROM PB

PostPosted: Tue Aug 22, 2017 10:34 pm
by jaykoller
Denis is the above mention script now in 6322?

Can you expand on it?

Re: GET FILE NAME FROM PB

PostPosted: Wed Aug 23, 2017 9:06 pm
by Dennis Kuypers
Hello,

In revision 6036 we added the following scripts:

VGetAssetMediaProjectFileNameByID
VGetAssetMediaFileNameByID
VGetAssetMediaProjectFolderByID

Is this sufficient?

Regards
Dennis

Re: GET FILE NAME FROM PB

PostPosted: Thu Aug 24, 2017 8:33 pm
by jaykoller
Thanks. I will try them out.

Re: GET FILE NAME FROM PB

PostPosted: Thu Aug 24, 2017 11:24 pm
by jaykoller
Forgive my ignorance on this Dennis. I can't seem to get this to work. Do I have to create a variable? I was able to find the command but can not get it to output to anything so I can actually see the name. When I open the variable table in WD I don't see this as one of the options.

Thanks

Jay

Re: GET FILE NAME FROM PB

PostPosted: Fri Aug 25, 2017 3:25 am
by justyn roy
Yes, create a variable.

Try this script:

Code: Select all
PbProjectRefresh

Var Name = ""
Var FolderID = 1

For FileID = 1 to 10 {
   VGetAssetMediaFileNameByID("Name",FolderID,FileID)
   DebugMessage(Name)
   WDWait(0.5)
   }


The third line is the FolderID you want the names of the files.

This uses "Local Variables" instead of "Global Variables" - so these won't show up in the Variable window, but you can do most everything you need to with these ones - it's just a little less messy.

This is a bit more complicated than you might need - but I thought I'd give an example of how to get multiple names in one script - this will give you the file names from 1 to 10 in folder 1 in a Debug Window.

Let me know if you have got any questions.

Justyn

Re: GET FILE NAME FROM PB

PostPosted: Fri Aug 25, 2017 3:27 am
by justyn roy
Also, are you using WD 6 or WD 4.7?

Re: GET FILE NAME FROM PB

PostPosted: Sat Aug 26, 2017 8:57 pm
by jaykoller
Justyn Roy wrote:Also, are you using WD 6 or WD 4.7?


6. I will try this as soon as I get a chance. Thanks!

Jay

Re: GET FILE NAME FROM PB

PostPosted: Fri Sep 01, 2017 10:38 pm
by jaykoller
So this does work for me. I can get the file names in the debug window. However I can not output them.

I tried using a variable input node to a label output node and because it is a local variable I can not pull the values. I feel like I am missing something quite obvious.

End result I am looking for is when using a media control panel, when I click the media button, it outputs the file name to a label.

Thanks

Jay

Re: GET FILE NAME FROM PB

PostPosted: Fri Sep 01, 2017 11:01 pm
by jaykoller
I did find a way to do this. Please let me know if there is a better way. I established three global variables to do this. Var_Folder, Var_File and ResourceName. 4,17 is the device in this case.

I have a media device showing images on one layer. I can get the file name with the following:

PBProjectRefresh
VGetDeviceMediaFolderID("Var_Folder",4,17)
VGetDeviceMediaFileID("Var_Folder",4,17)
VGetAssetMediaFileNameByID("ResourceName",Var_Folder,Var_File)

I then use a Variable input node for ResourceName that is linked to a Label Output node.