Creating a New Script

1. Navigate to Settings | Scheduler | Scripts 2. Choose an existing script create a script   3. Edit the script
import org.openedit.entermedia.Asset
import org.openedit.entermedia.MediaArchive
import org.openedit.*;

import com.openedit.WebPageRequest;
import com.openedit.hittracker.*;

public void init()
        // Regenerates a single asset
        final ASSET_ID = "109";
        MediaArchive archive = context.getPageValue("mediaarchive"); //Search for all files looking for videos
        Searcher searcher = archive.getAssetSearcher();
        Collection assets = searcher.getAllHits();

        Asset asset = archive.getAsset(ASSET_ID);
                if(asset == null)
          "Asset not found");
        asset.setProperty("importstatus", "imported");
        archive.saveAsset( asset,null);
               "now kick off import event");
        archive.fireMediaEvent("importing/assetsimported", user);

4. Click "Debug" button to test script and make sure it is running properly 5. Change the name appropriately New Script Name 6. Click "Save" button