Read the script settings in a filter

Hello

I have a Plug In which can read the script parameters and execute accordignly.

Examples of code in the SDK is called 'PoorMansTypeTool '.
In its documentation, it is said to be able to "read the script parameters.

I look at his code and yet I could not understand how it does.

Let's say I have a script with a variable "a".
The script launches a filter in the filter list and want to spend the worth of the parameter 'a' and the filter.

How this might be done?

There are constraints on the type parameter, size, etc?

Someone has already tried before?

If someone could guide me through the plug in the code, I would be happy.

Thank you.

This make a function so we can hide these harness script

main();

main() {} function

Save current preferences

var startRulerUnits = preferences.rulerUnits;

var startTypeUnits = preferences.typeUnits;

var startDisplayDialogs = displayDialogs;

Define Photoshop use pixels and display without dialog boxes

preferences.rulerUnits = Units.PIXELS;

preferences.typeUnits = TypeUnits.PIXELS;

displayDialogs = DialogModes.NO;

do this kind of things controlled by the harness

maxTime var = 1 * 60;

var iterations = 5;

var percIncrease = 20;

var timeIt = new Timer();

tests of var = 0;

Mistakes of var = 0;

eArray var = new Array();

var dissolveLog = new File ("~ / Desktop/Dissolve.log");

dissolveLog.open ('w', 'TEXT', '? ');

dissolveLog.writeln ('width, \theight, \tdepth, \tpercent, \tdoc create time, \tdissolve time');

maxWidth var = 30000;

var minWidth = 256;

var incWidth = parseInt ((maxWidth-minWidth) / iterations);

If (incWidth == 0)

incWidth = 1;

var maxHeight = 30000;

minHeight var = 256;

var incHeight = parseInt ((maxHeight-minHeight) / iterations);

If (incHeight == 0)

incHeight = 1;

Start cleaning

so that {(documents.length)

activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

var d = BitsPerChannelType.EIGHT;

for (var w = minWidth; w)< maxwidth;="" w="" +="incWidth" )="">

for (var h = minHeight; h)< maxheight;="" h="" +="incHeight" )="">

try {}

var Timeimport = new Timer();

If (d is BitsPerChannelType.EIGHT)

d = BitsPerChannelType.SIXTEEN;

on the other

d = BitsPerChannelType.EIGHT;

App.Documents.Add (UnitValue (w, "px"), UnitValue(h,"px"), undefined, "Dissolve Test", undefined, undefined, undefined, d);

timeImport.stop ();

If (activeDocument.width! = o)

error ++; Alert (activeDocument.width + "," + w);

If (activeDocument.height! = h)

error ++; Alert (activeDocument.height + ', ' + h);

If (d == 16 & activeDocument.bitsPerChannel! = BitsPerChannelType.SIXTEEN)

error ++; Alert (activeDocument.bitsPerChannel + ', ' + d);

If (d == 8 & activeDocument.bitsPerChannel! = BitsPerChannelType.EIGHT)

error ++; Alert (activeDocument.bitsPerChannel + ', ' + d);

If (activeDocument.bitsPerChannel is BitsPerChannelType.ONE)

error ++; Alert (activeDocument.bitsPerChannel + ', ' + d);

FitOnScreen(); What makes everything very slow

var historyState = activeDocument.activeHistoryState;

for (var dPerc = 0; dPerc<= 100;="" dperc="" +="percIncrease" )="">

tests ++;

var timeDissolve = new Timer();

Dissolve (dPerc);

timeDissolve.stop ();

WaitForRedraw(); Guess what this does to our slow er ness

dissolveLog.write (w + "\t" + h + "\t" + d + "," + dPerc);

dissolveLog.writeln (", \t" + timeImport.getTime () + "," + timeDissolve.getTime ());

WaitForRedraw();

activeDocument.activeHistoryState = historyState;

If (timeIt.getElapsed () > maxTime) {}

w = maxWidth + 1;

h = maxHeight + 1;

dPerc = 101;

}

}

}

{catch (e)}

alert (e + ":" + e.line);

If (e.message.search(/cancel/i)! = - 1) {}

w = maxWidth + 1;

h = maxHeight + 1;

}

eArray [eArray.length] = e;

Errors ++;

debugger;

} / / end of capture

} / / end of height

} / / end of width

dissolveLog.writeln (errors "mistakes." + test + ' tests in "+ timeIt.getElapsed () +"seconds."+ tests / timeIt.getElapsed () +" test/s.");

dissolveLog.close ();

dissolveLog.execute ();

end clean

so that {(documents.length)

activeDocument.close (SaveOptions.DONOTSAVECHANGES);

}

Reset the application preferences

preferences.rulerUnits = startRulerUnits;

preferences.typeUnits = startTypeUnits;

displayDialogs = startDisplayDialogs;

(1) "FAILURE" for failures

(2) "PASS" for the results of the test OK

(3) "BUG" for known bugs, are the file name give the bug number "

(4) ' ERROR', it comes from the beam so the script barfed/exception,

return errors == 0? 'PASS': 'FAIL ';

} / / end of main function

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////

/****************************

Function WaitForRedraw

Use: Use it to force Photoshop to redraw the screen before continuing

Example:

WaitForRedraw();

****************************/

function WaitForRedraw() {}

var keyID = charIDToTypeID ("Stte");

var / / desc = new ActionDescriptor();

desc.putEnumerated (keyID, keyID, charIDToTypeID ("RdCm'));

executeAction (charIDToTypeID ('Wait'), desc, DialogModes.NO);

}

//////////////////////////////////////////////////////////////////////////////

WaitNSeconds, slow down the script you can watch and understand the issues

//////////////////////////////////////////////////////////////////////////////

function WaitNSeconds (seconds) {}

startDate = new Date();

endDate = new Date();

While ((endDate.getTime () - startDate.getTime (())< (1000="" *="">

endDate = new Date();

}

//////////////////////////////////////////////////////////////////////////////

FitOnScreen, fits the document and redraws the screen

//////////////////////////////////////////////////////////////////////////////

function FitOnScreen() {}

var id45 = charIDToTypeID ("TPCV");

var desc7 = new ActionDescriptor();

id46 var = charIDToTypeID ("null");

var ref1 = new ActionReference();

var id47 = charIDToTypeID ("min");

var id48 = charIDToTypeID ("MnIt");

var id49 = charIDToTypeID ("FtOn");

Ref1.putEnumerated (id47, id48, id49);

desc7.putReference (id46, ref1);

executeAction (id45, desc7, DialogModes.NO);

}

//////////////////////////////////////////////////////////////////////////////

Dissolve, in view of a percentage

//////////////////////////////////////////////////////////////////////////////

function {dissolve (dPercent)

var id18 = stringIDToTypeID ("d9543b0c-3c91-11d4-97bc-00b0d0204936");

var desc3 = new ActionDescriptor();

id19 var = charIDToTypeID ("WTSA");

id20 var = charIDToTypeID ("#Prc");

Desc3.putUnitDouble (id19, id20, dPercent);

id21 var = charIDToTypeID ('disP');

id22 var = charIDToTypeID ("mooD");

var id23 = charIDToTypeID ("moD1");

Desc3.putEnumerated (id21, id22, id23);

executeAction (id18, desc3, DialogModes.NO);

}

//////////////////////////////////////////////////////////////////////////////

Was DissolveOld, our old script params

an interesting test would be to see the old plugin vs the current

//////////////////////////////////////////////////////////////////////////////

function DissolveOld (dPercent) {}

id12 var = charIDToTypeID ("disS");

var desc3 = new ActionDescriptor();

id13 var = charIDToTypeID ("WTSA");

var id14 = charIDToTypeID ("#Prc");

Desc3.putUnitDouble (id13, id14, dPercent);

id15 var = charIDToTypeID ('disP');

id16 var = charIDToTypeID ("mooD");

var id17 = charIDToTypeID ("moD1");

Desc3.putEnumerated (id15, id16, id17);

executeAction (id12, desc3, DialogModes.NO);

}

//////////////////////////////////////////////////////////////////////////////

Library for the things of JavaScript calendar

//////////////////////////////////////////////////////////////////////////////

function {Timer()

Member variables

this.startTime = new Date();

this.endTime = new Date();

member functions

reset the start time to now

This.Start = function () {this.startTime = new Date() ;}

reset the end time for the time being

This.Stop = function () {this.endTime = new Date() ;}

make the difference in milliseconds between start and stop

this.getTime = function () {return (this.endTime.getTime () - this.startTime.getTime (()) / 1000 ;}}

get the current elapsed time now, this command sets the end time

this.getElapsed = function () {this.endTime = new Date(); return this.getTime () ;}

}

end Dissolve.jsx

Tags: Photoshop

Similar Questions

  • How to open an attachment document otd? He always goes to note pad and I can't read the script?

    How to open an otd attachment in my email address? Currently, he attends the notebook and I can, t read the script. Thanks for your suggestions.

    How to open an otd attachment in my email address? Currently, he attends the notebook and I can, t read the script. Thanks for your suggestions.

    I suspect that you really like ODT file extension.  These are created in Open Office.  Download and install Open Office (it's free) or ask your correspondent to save files in a format compatible with any office application you are using (for example, Microsoft Word).  See this thread: http://help.lockergnome.com/office/open-openoffice-odt-file-Word-2003--ftopict929318.html

    Or visit http://odt-converter.com/

  • Create the variable and change it to read the script

    Hi all

    I can creat a reference to a global variable, but it creates only an accessible value in writing.
    How to change to read? Pls help!

  • Read the settings from the Illustrator

    Hello

    Is it possible to read the SDK settings when we begin to Adobe Illustrator.

    As if I'm leaving command promt Illustrator by using the following command:

    C:\Program File\Adobe\..\Windows> Illustrator "C:\file.ai" "Hi This Is Param"
    

    In the command above the first Param is file name HAVE, and the second is my dummy parameter...

    Now, I want to read the second parameter with the SDK and use this value in my plugin application.

    Thank you

    Hard

    On Windows, you can use GetCommandLine

  • Help required changing a script to include a filter

    Hello

    I am new to scripting and would like to help if possible.

    I would like to add a filter for the following script to only return results for VMS that were restarted in the last 24 hours, currently the script takes back all VM in my data center.  The script also requires a filter to exclude a call from cluster "Test Cluster"

    The script is as follows.

    $LastBootProp = @ {}
    Name = "LastBootTime".
    Expression = {}
    (Get-Date) - (New-TimeSpan-seconds $_.) Summary.QuickStats.UptimeSeconds)
    }
    }
    Get - VM | Get-View | Select Name, $LastBootProp

    Any help or advice would be greatly appreciated.

    Thank you.

    Hello, Jon2597-

    You can use the Where-Object cmdlet to filter the items that are returned.  To filter on the items that you said (VMs when LastBootTime is less than 24 hours and exclude computers virtual cluster 'Cluster of Test'), try something like:

    ## hash table to be used in calculated property$LastBootProp = @{    Name = 'LastBootTime'    Expression = {(Get-Date) - (New-TimeSpan -Seconds $_.Summary.QuickStats.UptimeSeconds)}}
    
    ## number of hours to which to compare gap since last boot$intHoursToGoBack = 24## get VM .Net View objects where time since last boot is less than 24 hoursGet-Cluster | Where-Object {$_.Name -ne "Test Cluster"} | Get-VM | Get-View -Property Name, Summary.QuickStats.UptimeSeconds | select Name, $LastBootProp | Where-Object {$_.LastBootTime -and ((New-Timespan -End (Get-Date) -Start (Get-Date $_.LastBootTime)).TotalHours -lt $intHoursToGoBack)}
    

    The latter gets where the cluster name is not equal to 'Cluster of Test', gets their VMs, gets a .net object from view of the VMs (with a few select properties) and displays those where the last boot is in the last 24 hours.  Get a little convoluted right vs virtual machines that uptime is less than 24 hours, but should give the same results.  The result would be something like:

    Name     LastBootTime----     ------------myVM01   6/12/2012 8:21:42 AMmyVM03   6/12/2012 6:50:37 AM...
    

    Worked ok for you?

  • Crash when reading the chronology

    When I start the first one, the control bugs screen as she displayed artifacts from what was on the screen before it opened. If I try to read the script, it will go black for a few seconds and then crash on the desktop with only the standard windows error message.

    The source monitor works fine and I can scrub through the timeline (if it does not display on the preview screen).

    I put 30 hours of work in the same project with this computer even before she decided to do. I think it happened when I allowed the first update itself of 0.2 to 0.3.

    All first and drivers are up to date. The Office has only been around for a week and is completely clean and not fragmented.

    I tried to reinstall the program, but the problem persists.

    Someone at - it experience of something similar?

    What happens if you create a new project and the problematic project improt in it?

    Another thing to try is to clear your cache of media. There are a few changes in some updates in the way in which the cache files are generated.

  • How to write the script in E-Tester

    Hi I'm new to e-tester. We do some R & D on the tool empirix e-tester. We are familiar with the QTP tool. We are able to save and read the script, but we cannot improve the script.

    But when I went through this son I did the knowledge that we can use the VBA or VB script script or etc. to improve the script. Currently we use version "oracle of functional tests for web applications 8.50.0260.

    Can any body please guide me and explain the procedure to improve the script and what is the use of the open script.
    It takes to e-load or e-tester. pls specify me its very urgent

    Thank you inadvance... pls

    Solène

    You can still add logic in the version 8.50 using VBScript, but the editor is not optimal; Right-click on the node in step-> select Insert Test -> Test Scriptlet , you have an API in the help files.

    OpenScripit is the new script tool, which, for the time being, only supports HTTP scripts (load), but with version 9.0, it will support functional testing, among other protocols, OpenScript DOM has a visual view script and java script view so you can make the most of scripts straight forward using the visual view and add more complex logic by using the view of java.

    Hope that helps

    Alex

  • Is there a way to read the settings in a .pst file?

    Hi all!

    I looked everywhere for info on this and found nothing. Anyone know how to read the settings contained in a .pst file? I found some that I really like, but would like to know what they are doing. In other words, what are the different used FX and what are their settings? I would use some other users have created as a starting point to create my own channels of FX. Open in a text editor doesn't show something like:

    @^@^@D^@^A^A^@^@^@^@^KEMAGPPST^@^@^A^H^@^@^@^@Âp^@^@^@^@^@^@^@^@^@^@^@^@^@^@¿< 80 > ^ @^ @^ @^ @^ @^ @^ @^ @^ @^ @^ @^ @^ @^ @? < 80 > ^ @^ @@ ^ @^ @^ @

    Is there a way to show somehow what they do and what they use the settings?

    Thank you!

    You're right, the settings file contain only of the code when opened in a text editor.

    But why don't you just open settings in a project, this way of seeing exactly what Plugins are loaded. Opening of the plug-in window will show you their parameters.

    The only restriction is that GarageBand has only a limited view of Plugin window which can not show all settings. To do this you must open in Logic Pro X.

    Hope that helps

    Edgar Rothermich - LogicProGEM.com

    (Author of "Graphically improved manuals")

    http://DingDingMusic.com/manuals/

    "I could receive some form of compensation, financial or otherwise, my recommendation or link."

  • Tecra M5 - SD card reader works with the factory settings

    Hi all
    My SD card reader has been in place. It will read a few cards of 4 GB and won't read other (usually newer).
    All cards in this problem area are Transcend cards 4GB SD (HC or whatever the format more later is)
    The cards, the M5 will not read can be read both my PDA, but also an old Tecra 9000 (who will also tell the other 4 GB cards)

    The PC was recently engineers have a problem so I asked to look at this problem. They reported that it was a software problem, because if they load the recovery CD (that is, to bring the machine to factory State) the SD card reader reads cards problem OK; Back to my setup and the SD card reader can not read cards SD - error message is "the request cannot be performed because of an i/o device error."

    So I guess that I need new drivers. Very well except that it has no drivers for the drive SD card itself. Its a part of the motherboard. There is a 'secure module SD' on the download from Toshiba site and I downloaded and installed the SD Secure module (dated 2008)
    However, Device Manager still shows that the SD host controller driver is Microsoft version 01/10/2002 6.0.4069.5

    If anyone has ideas on how to fix

    TFA
    R

    Hello!

    > back to my setup and the SD card reader will not read SD cards
    Can you explain what you mean, please?

    I put t understand why you n t run factory if it s a software problem. I never had problems with the factory settings because then I can make you that all functions work properly on my laptop.

    Good bye

  • DNS query script - need a way to script to query the DNS settings of all the servers on a domain

    Hi - I was wondering if anyone new a script or a simple way to query the DNS settings of all the servers on a domain? Basically, I need to know the primary and secondary, all our servers DNS settings and that discharge into a file. Any help is very appreciated

    Thanks in advance

    Hello

    As you try to run the DNS settings on the domain, I suggest you to post the same question on the Microsoft TechNet Forums

    You can follow the link to your question:

    Windows Small Business Server: http://social.technet.microsoft.com/Forums/en/category/windowsserver/

    It will be useful.

  • How to change the BIOS settings to read the Norton CD?

    In accordance with the instructions of Norton, I need to temporarily change the BIOS setting so that my computer will read the CD that has a Norton Bootable Recovery tool to start the computer. Norton's other attempts to remove the W32. SillyFDC.BDP worm failed, so they recommend using their recovery tool. How can I change the BIOS? Thank you.

    In accordance with the instructions of Norton, I need to temporarily change the BIOS setting so that my computer will read the CD that has a Norton Bootable Recovery tool to start the computer. Norton's other attempts to remove the W32. SillyFDC.BDP worm failed, so they recommend using their recovery tool. How can I change the BIOS? Thank you.

    You may or may not need to change the BIOS settings.  Assuming that you have a bootable CD with this tool, put it in your CD drive and restart the computer.  One of the 3 things will happen:

    1. the computer starts from the CD and you can follow all instructions you have Symantec.

    2 watching very carefully that the computer starts.  You may see a message that says something like "press any key to boot from the CD-ROM.  If you see this message, press a key (for example, the space bar) and the computer boots from the CD.

    3. watch very carefully that the computer starts.  You will see a message that says something like, "to change settings, press F1."  The key that you press on will be different depending on your particular computer.  It might be F1 or F10 or del key.  Whatever it is, press this button and you will enter the BIOS configuration utility.  From there, you can change the boot order to CD first.  Directions to navigate the BIOS Setup will be displayed on the screen, but they will involve using the button tab, enter, and arrow keys, because your mouse does not work in this utility.

    You can also take a look here: http://www.bleepingcomputer.com/forums/topic228631.html

  • I get the message cannot load the configuration settings whenever I try to download Adobe Reader

    I get the message cannot load the configuration settings whenever I try to download Adobe Reader

    Try to download the adobe reader Offline Installer.

  • How to change the settings on the computer so I can read the fonts adobe photoshop on Windows 8?

    Police is size 2 - Impossible to read, display in the Panel settings do not change the Adobe applications and other applications?

    Hello


    Let start with a question.
    The question is limited to Adobe Photoshop?
     

    If it is only with adobe Photoshop you will need to change the settings in Photoshop and check.
    I suggest that post you the same question in the adobe community to improve assistance.
    Check out the link and your question bouquet
    http://forums.Adobe.com/community/Photoshop
     

    Hope the above information helps.
  • reading the filter values (unsharp mask) defined in the dialog box

    for my sharpening script, I should be able to store values defined in the dialog for later use unsharp mask. The script calls the dialog box with DialogModes.ALL, then the values are set manually. Is it possible that I can tell the script to read the values defined and store them in variables.

    Can't find a topic referring to this problem.

    Thanks for any help.

    Hans

    2016, use it at your own risk.

    #target photoshop

    try {}

    var idUnsM = charIDToTypeID ("UnsM");

    var theResult is executeAction (idUnsM, undefined, DialogModes.ALL);.

    var theAmount = theResult.getUnitDoubleValue (stringIDToTypeID ("amount"));

    var theRadius = theResult.getUnitDoubleValue (stringIDToTypeID ("radius"));

    var theThreshold = theResult.getInteger (stringIDToTypeID ("threshold"));

    Alert ("amount" + theAmount + ' \nradius ' + theRadius + ' \nthreshold '+ theThreshold ")

    } catch (e) {};

    based on the code of michael l hale.

    function checkDesc2 {(theDesc)

    var c = theDesc.count;

    var str = ";

    for (var i = 0; i)

    Str = str + ' key "+ i +" = "+ typeIDToStringID (theDesc.getKey (i)) + ': ' theDesc.getType (theDesc.getKey (i)) +"\n"+ getValues (theDesc, I) +"\n ";

    };

    Alert ("desc\n\n" + STR);

    };

    check.

    function getValues (theDesc, number) {}

    switch (theDesc.getType (theDesc.getKey (theNumber))) {}

    case DescValueType.ALIASTYPE:

    Return theDesc.getPath (theDesc.getKey (theNumber));

    break;

    case DescValueType.BOOLEANTYPE:

    Return theDesc.getBoolean (theDesc.getKey (theNumber));

    break;

    case DescValueType.CLASSTYPE:

    Return theDesc.getClass (theDesc.getKey (theNumber));

    break;

    case DescValueType.DOUBLETYPE:

    Return theDesc.getDouble (theDesc.getKey (theNumber));

    break;

    case DescValueType.ENUMERATEDTYPE:

    return (typeIDToStringID (theDesc.getEnumerationValue (theDesc.getKey (theNumber))) + '_' + typeIDToStr ingID (theDesc.getEnumerationType (theDesc.getKey (theNumber)));)

    break;

    case DescValueType.INTEGERTYPE:

    Return theDesc.getInteger (theDesc.getKey (theNumber));

    break;

    case DescValueType.LISTTYPE:

    Return theDesc.getList (theDesc.getKey (theNumber));

    break;

    case DescValueType.OBJECTTYPE:

    return (theDesc.getObjectValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getObject Type (theDesc.getKey (theNumber)));

    break;

    case DescValueType.RAWTYPE:

    Return theDesc.getReference (theDesc.getData (theNumber));

    break;

    case DescValueType.REFERENCETYPE:

    Return theDesc.getReference (theDesc.getKey (theNumber));

    break;

    case DescValueType.STRINGTYPE:

    Return theDesc.getString (theDesc.getKey (theNumber));

    break;

    case DescValueType.UNITDOUBLE:

    return (theDesc.getUnitDoubleValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getUn itDoubleType (theDesc.getKey (theNumber)));

    break;

    by default:

    break;

    };

    };

  • Buttons on the right side of my window a 'comment' field and 'fill and sign' open whenever I open a document. In order to read the text, I need to minimize this field. As I open many documents every day I change the settings so

    Buttons on the right side of my window a 'comment' field and 'fill and sign' open whenever I open a document. In order to read the text, I need to minimize this field. As I open many documents every day, I would like to change the settings so that this field is reduced by default. Is this possible?

    Hi joelh68258411,

    The issue was already fixed in the update, please refer to this note of release hide the tools Panel in Acrobat and Acrobat Reader DC at all times.

    Kind regards

    Nicos

Maybe you are looking for

  • How to clear the contents of my old iPad without also erase it from my other?

    I backed up my new iPad Air2 use iCloud and now want to delete all the contents of my old iPad. How can I do this without also deleting the content of my new iPad?

  • OfficeJet pro 8610: 8610 high / low margin problem

    Hi people, Hope you can help.  I am trying to print a multiple page in Word format document (Office 365).  When the document is printed, the top margin on the first page is too big and the bottom margin is too small (the margins are set to 1 inch up

  • Cannot resurrect the aging X 61 Tablet

    I tried both the original DVD of Vista and XP Tablet Edn CD I got Lenovo to send me but no work - my ex-garantie X 61 Tablet will not start. As a last attempt, I try to install XP from my legit XP Pro CD, and this disc is in the drive or is not in th

  • Patch authentication LEAP Cisco space required for Windows 7 64 bit Home Edition

    Hi all: I tried both Vista Business 32-bit PC and Windows 7 Home edition 64 bit for Cisco LEAP Authentication. The result is that Vista Bz PC can have authentication option Cisco LEAP under wireless security option, Windows 7 Home Edition 64 bit does

  • drop-down list or a list with index

    I have a few drop-down menus with a large number of options (100 +), for example a selection of countries. Other platforms offer a clue, similar to the native contact app where you can select a letter on the right side to reach a certain letter. Does