Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 7:41 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: selecting filename as parameter
PostPosted: June 29th, 2013, 5:14 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
so long since I did anything advanced in Opus I've forgotten more than I knew to begin with, so help appreciated...

I want my users to be able to open a file location (always the same folder) then select one of the file-names they find there to use as a variable in a video object. (i.e. to launch a video). The folder will have files added and removed by the administrator, outside of Opus.

I don't want them to have access to the Windows browse directory option for security reasons.

even just a starting point would help??

thanks in advance

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: June 29th, 2013, 2:44 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Hi Mac,

I recall that some time ago, there was a post/discussion about generating a 'list of files' from a specific directory.

search.php?keywords=directory+list+files&terms=all&author=&sc=1&sf=all&sk=t&sd=d&sr=topics&st=0&ch=300&t=0&submit=Search

...from the search results, this thread has several ideas/solutions -- possibly including using a DLL from Mackavi (Interactiv)

viewtopic.php?f=4&t=1399&hilit=directory+list+files

Once you have the directory list, you have many ways to display and offer the User a way to select.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: June 30th, 2013, 2:03 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
Thanks for that- some very useful leads-
it occurs to me the best solution could be this:
since an admin is going to add video files to a folder they could also just add a filename to a list in a .txt file.
I could then read the file into a listbox and use code in some of the links you provided to launch the video player with the filename as a parameter?

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: June 30th, 2013, 3:27 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
hmmm
maybe more complicated than that- it seems listboxes cannot auto-update from text files the way text objects can!
So would I need to make an invisible text box which updates when publication runs, and use a script to transfer the text object contents to a listbox object? This is getting scary!

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: June 30th, 2013, 5:16 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
it seems listboxes cannot auto-update from text files the way text objects can!
If I understand what you are saying, yes Text objects can be linked to a file to load automatically.

However, there is minimal work to "populate" a Listbox object. Do a search on: populate listbox.

My own thinking would be to not put extra steps or workload on the admins -- to maintain a list after adding or deleting a file.

Depending which solution method you choose to get a Windows directory file listing -- it takes just a little manipulation to populate a Listbox, or to map those filenames to an Array variable. And there are other ways to handle it. (I don't know what Mack's DLL will do here, but that's another option).

Let us know what you feel comfortable with in scripting and loading a listbox -- and I or someone else here can help move you forward.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: June 30th, 2013, 7:41 am 
Offline

Joined: December 29th, 2004, 12:00 pm
Posts: 230
Location: Auckland NZ
Opus: v 7.04
OS: xp & win7
going with the updated text file for the time being-
if I read the txt file into a variable and insert it into standard text object it works fine.
if I read the txt file into a variable and insert it into a listbox it loses the line breaks and turns into a continuous string of text.
so near and yet so far.
I'm happy to give it a bash with opus script if it's not too complicated!

_________________
Opus Pro 7.04 - win10


For this message mac has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: May 30th, 2021, 6:54 pm 
Offline

Joined: January 8th, 2011, 1:39 am
Posts: 7
Opus: Pro v7.05
OS: Windows 7 rus
System: NB Toshiba P300-135, C2D1.8, ATI Mobility Radeon HD3470, 2gb
Hi!
I have the same problem.

In the text box, "\n" works as expected.
In Listbox - no.
Maybe there is already a solution to this problem?

Screenshoots:
https://yadi.sk/i/0naVfRDQEfchfQ
https://yadi.sk/i/jc4lwhHUQPrFUw

Actions:
Code:
var db = new Database("DSN=MPEK1;")
var RecSet = db.ExecuteSQL("SELECT * FROM personal")
var numTotal = RecSet.GetNumberOfRecords()
var ListArr = new Array()
var FinList = ""
var t1 = "\t"
var nl = "\n"
if (db.Connect())
for (var i=1; i<=numTotal; i++)
{
  FinList+= RecSet.Idp + t1 + RecSet.fio + nl
  RecSet.NextRecord()
}
else
{
 
}



Thanks.


Top
 Profile  
 
 Post subject: Re: selecting filename as parameter
PostPosted: May 31st, 2021, 8:46 pm 
Offline

Joined: January 8th, 2011, 1:39 am
Posts: 7
Opus: Pro v7.05
OS: Windows 7 rus
System: NB Toshiba P300-135, C2D1.8, ATI Mobility Radeon HD3470, 2gb
I solve this problem.

It's work...

Code:
var db = new Database("DSN=MPEK1;")
var RecSet = db.ExecuteSQL("SELECT * FROM personal")
var numTotal = RecSet.GetNumberOfRecords()
var lbox = ListboxP //Name of List Box
var t1 = "\t"
var n1 = "\n"

// Clear List Box
lbox.SetSelection(-1,0)
lbox.ReplaceSelection("")

if (db.Connect())
for (var i=1; i<=numTotal; i++)
{
// "Idp" ans "fio" - fields of table "personal"
  lbox.SetSelection(-1)
  lbox.ReplaceSelection(RecSet.Idp + t1 + RecSet.fio + n1)
  RecSet.NextRecord()
}
else
{
//  la-la-la
}



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group