SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-22-2007, 11:49 AM
roxy99 roxy99 is offline
Sage Expert
 
Join Date: Mar 2006
Posts: 516
Using MS Excel to manage multiple .my files

Anyone working with muliple my files for numerous episodes knows how tedious it can be to update and manage them.

Here is an easy way to use excel.

Step 1:

Create an Excel document and on Sheet1, Row 1: Fill out the following headings in row 1:

A1 : Old mpg file name
B1: Rename mpg to
C1 to ?1: valid My tag names; eg: Title, Releasedate, Actors, Synopsis


Step 2:

Create two command buttons and link the following VB script


Code:
Private Sub CmdListMpg_Click()
directory = ThisWorkbook.Path
With Application.FileSearch
.NewSearch
.LookIn = directory
.Filename = "*.mpg"
.SearchSubFolders = False
.Execute
For i = 1 To .FoundFiles.Count
Cells(i + 1, 1) = Left(Right(.FoundFiles(i), Len(.FoundFiles(i)) - Len(directory) - 1) _
, Len(Right(.FoundFiles(i), Len(.FoundFiles(i)) - Len(directory) - 1)) - 4)
Next i
End With

End Sub

Private Sub CmdCreateMy_Click()
Set data = Sheets("Sheet1").Range("a1")
records = Application.CountA(Sheets("Sheet1").Range("A:A")) - 1
For i = 1 To Application.CountA(Sheets("Sheet1").Range("A:A")) - 1
    Application.StatusBar = "Processing Record " & i
        Name ThisWorkbook.Path & "\" & data.Offset(i, 0).Value & ".mpg" As ThisWorkbook.Path & "\" & data.Offset(i, 1).Value & ".mpg"
    Open ThisWorkbook.Path & "\" & data.Offset(i, 1).Value & ".my" For Output As #1
    Print #1, data.Offset(0, 2).Value & "=" & data.Offset(i, 2).Value
    Print #1, data.Offset(0, 3).Value & "=" & data.Offset(i, 3).Value
    Print #1, data.Offset(0, 4).Value & "=" & data.Offset(i, 4).Value
    Print #1, data.Offset(0, 5).Value & "=" & data.Offset(i, 5).Value
    Print #1, data.Offset(0, 6).Value & "=" & data.Offset(i, 6).Value
    Print #1, data.Offset(0, 7).Value & "=" & data.Offset(i, 7).Value
       
    Close #1
Next i
      
Application.StatusBar = ""
MsgBox records & " My files were created and saved in " & ThisWorkbook.Path

End Sub

Step 3:

Save the excel file into the directory where the mpg files are present where you want to create the my files.

Step 4
Click 'List MPG' button -->column A is filled up with all the the mpg file names (minus the .mpg extension

Step 5:

Give new names if you like in column B or just copy the same name over.

Step 6:

Fill out the rest of the table with the show data

Step 7:

Press the 'Generate my files' button.


PS- I've attached a sample xls with the VB script included already

PPS- You can modify the script to take .avi as input files by changing all .mpg to .avi in the VB script.
Attached Files
File Type: zip StarTrekEnterpise.zip (19.1 KB, 248 views)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.