Skip navigation
Ramon Kroese
Currently Being Moderated

Change scratch disks preferences by using vbscript

Oct 16, 2009 5:31 AM



Is it possible to change the preferences for the scratch disk(s) through a (vb)script?




  • Currently Being Moderated
    Oct 16, 2009 6:30 AM   in reply to Ramon Kroese

    Sorry can't help with VB but this is how I would do it in JavaScript..

    var List = ["C:\\","G:\\","I:\\"];
    function scratchDisk(List) {
       var desc = new ActionDescriptor();
            var ref = new ActionReference();
            ref.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('CchP') );
            ref.putEnumerated( charIDToTypeID('capp'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc.putReference( charIDToTypeID('null'), ref );
            var desc2 = new ActionDescriptor();
                var list = new ActionList();
       for(var a in List){
                list.putString( List[a]);
            desc2.putList( charIDToTypeID('ScrD'), list );
            desc2.putUnitDouble( charIDToTypeID('MmrU'), charIDToTypeID('#Prc'), 70.000000 );
        desc.putObject( charIDToTypeID('T   '), charIDToTypeID('CchP'), desc2 );
        executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
    Mark as:
  • Currently Being Moderated
    Oct 16, 2009 7:32 AM   in reply to Ramon Kroese

    That should work if the list contains valid drives. It might be best to test it with ExtendScript Toolkit (Set to Photoshop).

    Also if you need it in VB you could use the ScriptListener Plugin and utilize the VB code that it produces.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points