I wrote my own some time ago. You are welcome to it. Just change the path to your graphics application:
//*******************************************************************
//* Program: OpenInGraphicEditor.cs
//* Author: John Rofrano
//* Updated: December 27, 2009
//* Copyright: (c) 2009, John Rofrano, All Rights Reserved
//********************************************************************
using System;
using System.Diagnostics;
using System.Windows.Forms;
using Sony.Vegas;
public class EntryPoint
{
String graphicsProgram = @"C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe";
public void FromVegas(Vegas vegas)
{
try
{
VideoEvent videoEvent = FindFirstSelectedVideoEvent(vegas.Project);
if (videoEvent != null && videoEvent.ActiveTake != null)
{
Process.Start(graphicsProgram, "\"" + videoEvent.ActiveTake.MediaPath + "\"");
}
else
{
MessageBox.Show("You must select a video event before running this script", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Critical Error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
}
/// <summary>
/// Returns the first selected video event
/// </summary>
/// <param name="project"></param>
/// <returns>The first selected video event or null if no video event selected</returns>
public VideoEvent FindFirstSelectedVideoEvent(Project project)
{
foreach (Track track in project.Tracks)
{
// only check video tracks
if (!track.IsVideo()) continue;
foreach (VideoEvent videoEvent in track.Events)
{
if (videoEvent.Selected)
{
return videoEvent;
}
}
}
> "as in other thread: started working when I set vegas to open as administrator."
That's odd because this works for me and I never open Vegas as an administrator. Are you working from some "limited" user account? If your account is not an administrator in Windows, it should be. Working as a non-administrator is severely broken in Windows and doesn't work like it does on Unix and the Mac. Microsoft never quite understood how to do this right even though they tried to fix it in Windows 7.
JohnnyRoy:
I am not working from a limited user account. I use Vista 64bit with both Vegas 10E 32/64 bit. After setting Vegas to open as administrator I lost the Shuttle pro operation which worked fine before. DVD-A-Pro 5.2 was not opening either and the reccommended fix (Sony Support) was to "Open in Adminstrator" but I discovered this too late and 5.2 would not uninstall so I removed all 5.2 stuff from the registry and it still will not re-install. Sony Support says to re-install Windows. I don't wanna do that at this time.
JJK
win 7 64bit - logged on as admin (there are no other users). until i couldn't get 'open with....' to work i've never encounter any problem whatsoever regarding user rights. opening vegas as admin cured the open with... straight off.
everything else, so far seems (thankfully!) unchanged.
When I set Vegas 10E to run as administrator I lost the shuttle pro operation. This was because when I open "Shuttle Pro" the "user account control" stops it. I went into the user stuff in the control panel and shut off the "user account control", re-booted and everything worked fine without putting Vegas as administrator. So now everything works including DVD-A 5.0B which had to be in the administrator mode also. This is what initially caused my DVD-A 5.2 to self destruct. Sorry about mis-leading in my previous threads.
JJK