[AI 10]How to create a Spot Swatch(CMYK&RGB)?

Hi,
Please tell how to create a spot color swatch & add it to the swatches pallette in Illustrator 10.
I want to specify the swatches name,color(CMYG,RGB)& type(Spot or Process).
I tried the following itdoes not give the desired output:
AICustomColor customData;
AICustomColorHandle newColor;
strcpy((char*)customData.name ,"PANTONE 119 C");
customData.c.f.cyan = 0.75;
customData.c.f.magenta =0;
customData.c.f.yellow = 0.50;
customData.c.f.black = 0;
customData.flag = kCustomSpotColor;
customData.kind = kCustomFourColor;
error = sAIColor->NewCustomColor(&customData,&newColor );
AIDocumentHandle document = NULL;
error = sDocument->GetDocument(&document);
AISwatchListRef swatchList;
error = sAISwatch->GetSwatchList(document, &swatchList);
AISwatchRef swatch = NULL;
swatch = sAISwatch->GetSwatchByName(swatchList, (char*)customData.name);
swatch = sAISwatch->InsertNthSwatch(swatchList, 3);
error = sAISwatch->SetSwatchName(swatch, (char*)customData.name);
AIColor aicolor;
aicolor.kind=kCustomColor;
aicolor.c.c.tint = 0.75;
aicolor.c.c.color = newColor;
error = sAISwatch->SetAIColor(swatch, &aicolor);
Please suggest where i go wrong?
Myriaz

I'm afraid this outside of my realm of expertise, having never tried this. Hopefully someone else can lend a hand here.

Similar Messages

  • How to make a spot swatch with specific name by using AppleScript?

    Hi there,
    I am trying to create a script in AppleScript to make a new spot color swatch that must be the COLOR TYPE : SPOT (with specific values). I've got it to make a global process color but can't seem to make a spot swatch. I'm using the script below :
    tell application "Adobe Illustrator"
        set docColorSpace to color space of document 1
        if (docColorSpace is CMYK) then
            set SpotColor to {cyan:100.0, magenta:0, yellow:0.0, black:0.0}
        else
            set SpotColor to {red:0.0, green:174.0, blue:239.0}
        end if
        make new spot in document 1 with properties {name:"ADHESIVE", color:SpotColor}
    end tell
    I did find an entry in an old forum that did this using javascript, however, I am not experienced with this at all and have no idea what or how to use it on a mac platform. This script is listed below.
    #target illustrator
    var docRef = app.activeDocument;
    var newCMYK = new CMYKColor();
    newCMYK.cyan = 100;
    newCMYK.magenta = 0;
    newCMYK.yellow = 0;
    newCMYK.black = 0;
    var thisSpot = docRef.spots.add();
    thisSpot.name = 'ADHESIVE';
    thisSpot.color = newCMYK;
    thisSpot.colorType = ColorModel.SPOT;
    Any help would be greatly appreciated.
    Thank you!

    You are close but missing the last property listed in the JavaScript… It translates to… 'color type:spot color'
    tell application "Adobe Illustrator"
    set docColorSpace to color space of document 1
    if (docColorSpace is CMYK) then
    set SpotColor to {cyan:100.0, magenta:0, yellow:0.0, black:0.0}
    else
    set SpotColor to {red:0.0, green:174.0, blue:239.0}
    end if
    make new spot in document 1 with properties {name:"ADHESIVE", color:SpotColor, color type:spot color}
    end tell
    BTW… The use of JavaScript in the CS apps is more common because of its 'platform independence' There is a toolkit supplied along with the CS install.

  • Reg: How to Create Enhancement spot in $TMP Package

    Hi All,
    i had seen so many eLearning concepts which sap provided to demonstrate the ENHANCEMENTS Topic,But in that they are using the Enhancement Spots which already created in $TMP Package,So To learn this concept i am trying to create the Enhancement Spots in $TMP , But it is not allowing me to create in $TMP and it's showing the error message like Enhancements can create in only 'SAP' Packages only,So  if i will create in SAP Packages it is allowing,
    But i would like to create Enhancement Spots in $TMP Package,So it would be appriciable any one could help me regarding this.
    Thanks in Advance
    Srihasa...

    Thanks Rasheed for your quick response, i tried from the SE 38 To create Enhancement Spots in the $TMP Package,But it's not allowed me,Can you tell the way how to create the Enhancement Spots in the $TMP Package i mean is there any other Tcodes are available to create the Enhancement Spots.
    Thank you..
    Srihasa

  • How to create a Gradientcolor from two existing swatches

    Hello all,
    I have 2 colors in the swatches palette.has anyone how to create a new gradient color from this to swatches.
    So far I can get my to colors from the palette and extract their color:
    aSwatch1 = sAISwatchList->GetSwatchByName( colList, colorName1 );
    aSwatch2 = sAISwatchList->GetSwatchByName( colList, colorName1 );
    iErr = sAISwatchList->GetAIColor( aSwatch1, &colorP1);
    iErr = sAISwatchList->GetAIColor( aSwatch2, &colorP2);
    // now somehow create a new gradient:
    iErr = sAIGradient->NewGradient( &gradientHnd );
    but what do now. to get the new color from colorP1 and colorP2. I need a simple linear gradient.
    Any hints?
    regards
    Michael

    Hello,
    > Please, excuse any ignorance below. I'm not well versed in the actual artistic side of Illustrator, just the implementation
    excused because you're the one of the few people here who give thoe most usefull answers
    > Isn't that to be expected though? From my admittedly limited understanding, the gradient being saved is really just a sequence of colour stops. I would have thought since the angle of the gradient is more of a property of how its applied to the path (or whatever) that it wouldn't make sense to save it on the gradient colour.
    No, not from my view (and needs ).
    The color for the gradient has a type of AIGradientStyleMap. this struct contains the angle für the linear gradient etc. This color is added to the swatchpalette so it shoud keep the value.
    If you replace the CreateGradientSwatch function in SnpGradien.cpp of the SnippetRunner with the following code a 2nd swatch with an different angle is added to the swatchpalette when creating a new linear gradient is created (name seems not what it should but 2 swatches are created. Applying this 2 swatches to a rectangle also the angle is changed as it should be.
    So from my point of view Illustrator doesn't take the angle when a new color/swatch is created in the swatch panel. Why the angle is saved by creating a style is another question and difficult to answer without looking inside the source of Illustrator
    ASErr SnpGradient::CreateGradientSwatch(const AIGradientHandle gradient, AISwatchRef& swatch)
    ASErr result = kNoErr;
    try {
    // Insert new swatch at end of general swatch group.
    swatch = sAISwatchList->InsertNthSwatch(NULL, -1);
    // Get gradient name.
    ai::UnicodeString gradientName;
    result = sAIGradient->GetGradientName(gradient, gradientName);
    aisdk::check_ai_error(result);
    // Set swatch name.
    result = sAISwatchList->SetSwatchName(swatch, gradientName);
    aisdk::check_ai_error(result);
    // Create the swatch color using the gradient.
    AIColor swatchColor;
    swatchColor.kind = kGradient;
    swatchColor.c.b.gradient = gradient;
    swatchColor.c.b.gradientAngle = 30;
    swatchColor.c.b.gradientLength = 1;
    AIRealPoint origin = {0,0};
    swatchColor.c.b.gradientOrigin = origin;
    swatchColor.c.b.hiliteAngle = 0;
    swatchColor.c.b.hiliteLength = 0;
    SnippetRunnerLog::Instance()->WritePrintf("gradientAngle: %.1f",swatchColor.c.b.gradientAngle);
    SnippetRunnerLog::Instance()->WritePrintf("gradientLength: %.1f",swatchColor.c.b.gradientLength);
    SnippetRunnerLog::Instance()->WritePrintf("gradientOrigin (v / h): %.1f /  %.1f", swatchColor.c.b.gradientOrigin.v, swatchColor.c.b.gradientOrigin.h);
    SnippetRunnerLog::Instance()->WritePrintf("gradientAngle: %.1f",swatchColor.c.b.gradientAngle);
    SnippetRunnerLog::Instance()->WritePrintf("hiliteLength: %.1f",swatchColor.c.b.hiliteLength);
    // Set the swatch color.
    result = sAISwatchList->SetAIColor(swatch, &swatchColor);
    aisdk::check_ai_error(result);
    // making a 2nd swatch
    AISwatchRef swatch2;
    swatch2 = sAISwatchList->InsertNthSwatch(NULL, -1);
    result = sAISwatchList->SetSwatchName(swatch2, (ai::UnicodeString("Grad2")));
      // Create the swatch color using the gradient.
      AIColor swatchColor2;
      swatchColor2.kind = kGradient;
      swatchColor2.c.b.gradient = gradient;
      swatchColor2.c.b.gradientAngle = 60;
      swatchColor2.c.b.gradientLength = 1;
      swatchColor2.c.b.gradientOrigin = origin;
      swatchColor2.c.b.hiliteAngle = 0;
      swatchColor2.c.b.hiliteLength = 0;
    result = sAISwatchList->SetAIColor(swatch2, &swatchColor2);
    catch (ai::Error& ex) {
    result = ex;
    return result;
    The CS3/CS4 question is easy: for CS3 i use the CS3 SDK and for CS4 I#m working with the CS4 SDK :-)

  • HOW TO CREATE  BADI IN ECC 6.0 with Enhanance Spot?

    HI,
          Anyone let me know how to create BADI in ECC 6.0 , which have mandtory to create enhanance spot before to create badi?  I dont understand the concept of Enhanance Spot and what is the purpose to create that . Will u plz let me know step wise procedure to create badi ...
    Thanks,
    saurin.

    Hi,
    Implementing Business Add-Ins (BADI)
    The use of object orientated code within SAP has lead to new method of enhancing standard SAP code called
    Business Add-Ins or BADI's for short. Although the implementation concept is based on classes, methods and
    inheritance you do not really have to understand this fully to implement a BADI. Simply think of methods
    as a function module with the same import and export parameters and follow the simple instructions below.
    Steps:
    1. Execute Business Add-In(BADI) transaction SE18
    2. Enter BADI name i.e. HRPBSGB_HESA_NISR and press the display
    button
    3. Select menu option Implementation->Create
    4. Give implementation a name such as Z_HRPBSGB_HESA_NISR
    5. You can now make any changes you require to the BADI within this
    implementation, for example choose the Interface tab
    6. Double click on the method you want to change, you can now enter
    any code you require.
    7. Please note to find out what import and export parameters a
    method has got return the original BADI definition
    (i.e. HRPBSGB_HESA_NISR) and double click on the method name
    for example within HRPBSGB_HESA_NISR contract is a method
    8. When changes have been made activate the implementation.
    http://esnips.com/doc/10016c34-55a7-4b13-8f5f-bf720422d265/BADIs.pdf
    http://esnips.com/doc/e06e4171-29df-462f-b857-54fac19a9d8e/ppt-on-badis.ppt
    http://esnips.com/doc/43a58f51-5d92-4213-913a-de05e9faac0d/Business-Addin.doc
    http://esnips.com/doc/1e10392e-64d8-4181-b2a5-5f04d8f87839/badi.doc
    http://esnips.com/doc/365d4c4d-9fcb-4189-85fd-866b7bf25257/customer-exits--badi.zip
    http://esnips.com/doc/3b7bbc09-c095-45a0-9e89-91f2f86ee8e9/BADI-Introduction.ppt
    SEE THE LINKS REGARDING SPOT
    /people/thomas.weiss/blog/2006/01/24/what-the-new-enhancement-framework-is-for-150-its-basic-structure-and-elements-for-beginners
    /people/thomas.weiss/blog/2006/03/15/the-new-enhancement-framework-part-2--what-else-you-need-to-know-before-building-an-enhancement
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    Regards
    Kiran Sure

  • How to create a hot spot for a browser filled image?

    I have a background image created in Photoshop in the browser fill, scale to fill. 
    This is my landing page and would like to create a hot spot or "invisible" rectangle to link to another page in my site when clicked.
    I have this done and working, however, my problem is that when my browser size is enlarged or reduced, the spot where I want the hot spot to be changes in size and location.
    I want to create a hot spot that will keep its form around my logo no matter the screen size. 
    I have tried this with a no fill box and white stroke to see how it reacts with each fill property but cannot figure out how to create a box to be in a fixed position that will always match up
    with the browser fill image location and size.
    Thanks for your help.

    Hi
    Have you tried to pin the box on page so that it should be in fixed position ?
    Also if want the box to be on some specific position with page scroll, then you can try applying scroll effects which would scroll the box on page but within defined positions.
    Thanks,
    Sanjit

  • How to create a swatch library from multiple png files?

    Illustrator CC
    I am having a difficult time trying to create a new swatch libray of patterns from multiple png files. The way I am doing this is very slow and repetitive and seems silly for a tool as advanced as the latest CC suite including illustrator.
    What it seems I must do is open all the png files in Illustrator, creating multiple workspaces, drag one png file into the swatch window, then save that window as a library, close the existing window to reveal the next png file, open the user library I just created, drag the next image into the currently active swatch window, then drag the previous swatch/s from the user library into the current active swatch window, resave and replace the user defined swatch library (now with two images in there)fromthe updated current active swatch panel/window, close the existing workspace to reveal the next image file, and then repeat the process again, slowly building the user defined swatch library up by adding one image at a time and then adding back into the Swatch panel the previously built up library of swatches again one at at time.  (you can select all from the existing  user defined library and drag over into swatch panel, but this creates at least one  duplicate on each cycle for as soon as you click on the first swatch in the library, it adds itto the current swatch panel and then when you select all swatches to drag across it includes the first swatch and copies it again)
    This is a very slow process to build up a swatch library. For some reason you cannot drag swatches directly into  the user defined library you have created, only into the active swatch window for each workspace. I searched the web and forums  for answers but could find none. There must be an easier way,  just can't find it.
    Ideally, the best option would be a swatch window  option that allows the import directly from a list of selected files in the finder.
    Any ideas out there?

    Monika,
    Thank you for responding, however I am not exactly clear on what you mean by "libraries are plain AI files". For example, I cannot find a file with the same name as my user defined library name that I have created. I can find the preinstalled swatches listed under Adobe Application Support... Library... Swatches, but a user defined folder is not present and the library sets that I have already created are not visible. I have tried searcing my Mac for a (name).ase file and still no luck (at least for the name I was looking for). I can open the user defined library from the Swatch library icon on the bottom left of the Swatch panel, but when I open this I cannot drag and drop add new swatches directly to this library. As stated above, I have to add each pattern, one at at time to the normal swatch panel, then add back the previous ones I have saved from the user defined library to the swatch panel and then save threm all as an updated user defined library. Thus by repeating this process, it builds up the user defined library one at a time.
    I am using Illustrator CC if this makes a difference.

  • How do I create outlines for created pattern (or swatch) for laser cut?

    Hi,
    I can't figure out how to create outlines (vector lines) for my patterns , as I need to laser cut the pattern, and all the lines have to be seen,
    Please help!
    I use Illustrator CS6.

    mer,
    What happens if you Object>Expand?

  • [AI 10]How to create a global process swatch?

    Hi,
    Please provide code snippets for creating a new global process swatch(the global check box ticked in Swatch options) with the speficied name,color values & color mode(CMYK,RGB)in Illustrator 10.
    Thanks in advance.
    myriaz

    I'm afraid this outside of my realm of expertise, having never tried this. Hopefully someone else can lend a hand here.

  • How to creat a hot spot on my iphone 4s

    I would like to know how to creat a hotspot with my iphone 4s

    Yeah, I guessed something like that had happened - it's got me a few times too!! Not the only long-standing, unfixed "quirk" these forums have either...

  • How to correctly use spot colours in Photoshop?

    Hi,
    Using CS2, I've created one of those swooshy Macintosh Panther wallpaper images, with various layers of sweeping lines and tinted gradient arcs.
    Now I want to create the image using just tints of pantone 519 but I'm unsure of how to work with pantone colours in photoshop. I've pulled up the solid coated pantone library and located the swatch, but how do I specify various tints of this colour?
    I've searched the forum and come across spot channels, and have read the photoshop help entry on this, but still can't understand how to do it. From what I've read, I make a selection, then create a spot channel of the colour and set the solidity to 100%. If I want an 80% tint, I just adjust the solidity to 80%. Is this correct, or is the solidity more like transparency than tint?
    In addition, how do I create a gradient between these two colours?
    Final question - I have an element I want to import from Illustrator that uses the same spot colour. Do I have to deal with this any differently to the normal copy and paste as a smart object?
    Sorry, I'm sure this is really quite easy.
    Thanks for any help.
    Steven

    Why not just mode grayscale (or better yet a black and white adjustment layer, then mode grayscale), adjust levels, new spot channel, move dot from gray channel to spot channel? If it was made in RGB 519, your green channel is probably best to make the move to grayscale. If you're working in CMYK, then the magenta channel (unless of course you're using pictures with UCR/GCR).
    <br />
    <br />I guess I don't understand how you can say "I'll set it up best in CMYK" but can't get it to one color.
    <br />
    <br />Here's the tut version using the green channel only. If you do some channel mixing, I'm sure you could get something a little nicer.
    <br />
    <br />
    <a href="http://www.pixentral.com/show.php?picture=1jaDKpRgglatQZJhuknYJ4TLhAUUq1" /></a>
    <img alt="Picture hosted by Pixentral" src="http://www.pixentral.com/hosted/1jaDKpRgglatQZJhuknYJ4TLhAUUq1_thumb.jpg" border="0" />

  • How may I import Pantone swatches (already on Mac)

    Hello
    I'm new to all this, having purchased this years ago but not used it much.    I have Indesign CS (3.0.1) on my mac running OSX 10.4.11.I don't have very many color swatches in Indesign so downloaded the files from the Pantone site which put them in my library.  However, following their instructions, I cannot create a new swatch or view their files.  I've tried opening swatches, highlight none, gone to new next to the trash bin, but it is dim and presents a crossed out circle.
    So, try to do it manually.  but the file that I eventually get to under Indesign in the Pantone Library, is an .ai file that Indesign doesn't like.
    How can I get a decent color library into Indesign.  Pantone would be preferred.
    Thanks.

    Foz407 wrote:
    OK, I stand chastened, but the first image is nothing like what I see in Indesign.
    I opened the menu for you in the illustration. The little area I circled is the button to open it. You'll find one on every panel.
    You have four choices for swatches, basically, in ID. You can set them as defaults by adding with no docs open. You can load them one at a time in any doc (use the add button, rather than OK in the dialog to avoid closing it). You can load all the swatches from any other document, or you can import an Adobe Swatch Exchange file saved from any Adobe app by using the Load Swatches command (and you can do that with nothing open to set them as defaults). You can import art that uses a defined swatch.
    ID will express unhappiness if you try to have more than 10 spot colors defined in a document, and your printer will express unhappiness somewhere around two spot colors in most cases.

  • How to create a user account by mirroring another account in PowerShell (Trying to learn to use Powshell for some daily AD tasks intead of the GUI)

    Hi,
    I am trying to create user accounts via PowerShell instead of the Gui in server 2008 R2 (PowerShell 2.0).
    I know how to create a user account with the following Power Shell command below is one from a dummy domain I created to practice.
    PS C:\Users\Administrator> New-ADUser -SamAccountName "TestOut" -UserPrincipalNa
    me "[email protected]" -GivenName "Test" -Surname "out" -DisplayName "Testou
    t" -Name "Testout" -Enabled $true -Path "CN=users,DC=bwcat,DC=net,DC=int" -Accou
    ntPassword (Read-Host -AsSecureString "Enter Account Password") 
    However when doing day to day tasks where I work normally we have a new hire, they contact IT and ask that a user account is created.   I will ask who they would like to mirror.
    I then would go into the gui pull up the user that they want to mirror right click him and choose copy.  This would create a new user account that I would then fill out.
    I am wondering if its possible to do this same thing via PowerShell, or  if its not an option because it takes more work type up everything than it does to go into the gui and do it.
    Anyway thanks for the help.

    Hi Wilder, hi Mark,
    first of all: The tutorial sources Mark posted - especially the book "Powershell 3 in A month of lunches" - are good to get a baseline start. A really great reference, especially when you try to learn it while still dealing with your daily business.
    On another note, Wilder: While I fully agree that learning things sequentially is usually the best, I too jumped right in instead of learning how to walk first (though it's been some time now. Fewer years than you'd think, but still ...). So I thought I'd
    give you a little aid with that function husk, so you could just stuff interesting bits into an available structure, making use of the fun tools in a useful context (It's fun fiddling around with the commands, but if you have to type in all of them manually
    each time, using the GUI is often just faster. Doing fun things and being efficient with it feels even better though ...). So ... while I
    do agree with yourself, learn it the Correct & Proper Way, I also do
    intend to finish this little explanation about the husk, all the way to the end.
    Everything below this paragraph is part of this.
    function Copy-ADUser
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    ) # Create finished Strings
    $JoinedName = $GivenName + "." + $Surname
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName $JoinedName -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is again the same function husk I posted earlier. Only this time, I filled a little logic (the pieces that were already posted in this thread). This time, I'll not only go over each part again ... I'll do it by reposting the segments and trying to show
    some examples on how to modify the parts. Thus some of it will be repetitive, but this way all the info is in one spot.
    Segment: Comment Based Help
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    That's the premier documentation part of a function, that teaches a user what the function does and how to use it. It's what's shown when using the Get-Help cmdlet.
    Comment texts are not restricted to single lines however. For example you could replace ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    ... with ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    Creates a new user named Max Mustermann and copies the group memberships of the already existing user Jonny Normal to this new User
    ... and get an explanation on what the example does when using Get-Help with the
    -Detailed parameter (Explaining examples is always a good idea).
    Segment: Parameter
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    This is the segment that tells Powershell what input your function accepts. Each parameter of Copy-ADUser you set will be available in the next segment as a variable of the same name. You can add additional parameters if you need more information for your
    logic. For example, let's add a parameter that allows you to specify what Organization the new user should belong to:
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [string]
    $Organization,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    That's how that would look like. You may notice that I didn't add the line with
    "[Parameter(Mandatory = $true)] this time. This means you
    may add the Organization parameter when calling Copy-ADUser, but you need not.
    Segment: Logic
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is the part of the function that does the actual work. Compared to the first husk I posted, this time there are two commands in it (and some comments). First, I create a new user, using the information passed into
    the parameters -Surname and -GivenName. Then I Copy the group memberships of the user identified by the information given by the
    -Template parameter.
    So, let's modify it!
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    Now after adding a few lines, the logic will tell us what it's doing (and do so before it
    is taking action)!
    Hm ... didn't we create a change in the Parameter Segment to add an -Organization parameter? Let's use it!
    # If the -Organization parameter was set, the $Organization variable will be longer than 0. Thus do ...
    if ($Organization.Length -gt 0)
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname in the Organization $Organization"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -Organization $Organization -PassThru
    # If the -Organization parameter was NOT set, the $Organization variable will have a length of 0. Thus the if-condition does not apply, thus we do the else block
    else
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    There! Now we first check whether the -Organization parameter was set (it's not mandatory after all, so you can skip it). If it
    was set, do whatever is in the curly braces after if (...). However, if it wasn't set, do whatever is in the curly braces after
    else.
    And that concludes my "minor" (and hopefully helpful) tutorial on how to use the function husk I posted :)
    With this, whenever you find another cool command that helps you in the user creation process, you can simply add it, similar to what I did in these examples.
    And if it all didn't make much sense, go through the tutorials in proper order and come back - it'll make much more sense then.
    Cheers and good luck with PowerShell,
    Fred
    There's no place like 127.0.0.1

  • How to create subpicture for a button?

    Hello!
    I have really tried to find the answer to this rather silly problem on my own, but without result. Please help someone!
    The situation:
    I have a menu with three choices: "Play Movie", "Scene Selection" and "Subtitles". Now, the text presenting these choices are part of the background image, created in Premiere (the program I know best). They are written with an old typewriter to get that gritty feeling.
    I want the user to scroll between these "menu items". The currently selected item should be indicated by a black circle/spot/dot before the text of the item. By default, when the menu appears, there is a black circle in front of (to the immediate left of) the item "Play Movie". The user should now be able to step with his/her remote to the other items, thereby making the black circle in front of "Play Movie" disappear and appearing instead before some of the other items. In short: the black circle is always showing before the currently selected item. OK, I got a bit verbose there, but the idea got across hopefully. One more thing: the background color is 100% white.
    Up to this point, my solution was this: I placed black circles (small images with gradation and all, very nice looking) in front of ALL THREE ITEMS. Then I convert these into buttons. Then I choose the color set for the menu so that the unselected state is 100% white, plain and simple, with 100% opacity, thereby covering the black circles that should not show. Only in the selected and activated states does opacity for the button subpicture drop to 0%, thereby revealing the black circle that should be seen.
    The problem? Well, on some DVD-players (not on the XBOX 360 though), when an item is activated, all three circles show for a brief moment before the selected action starts (for example playing the movie). It also happens in Encore Preview. This is not logical at all and looks amateurish. I don't know why it happens, but my guess is that it wouldn't if I did this the "correct" way: by creating subpictures fo the buttons in the shape of circles. I understand the nice looking gradations must go out the window but that is a price I'm willing to pay.
    But now I run into an unexpected problem: I don't understand how to create a subpicture for the button that is a black circle. It seems the documentation in Encore and on forums in general takes for granted that you know how to do this.
    What I tried ws this: I created a monochrome, small image in bmp format - a black circle on white background. But this image just shows up as a black rectangle in Encore.
    What should I do? I should add that I have no real experience with Photoshop, so go slow if you go there.
    Regards,
    Nikolaj

    Basically, when one realizes the limitations of the Sub-picture Highlights, as set by the DVD-specs., it's easy to see the "workaround."
    A couple of the aspects of Sub-picture Highlights are:
    1.) 2-bit color (either ON, or OFF), from a limited color palette, with degrees of Transparency (the opposite of PS's Opacity).
    2.) they will appear on top of anything else on the Menu, including things like Button text/graphics.
    By constructing your Sub-picture Highlight in PS, you can use Masking to define where it will be, and where it will not be. In the case that prompted my article, the poster had a series of Text Buttons, and the Sub-picture Highlights were formed from that Text. The poster did not like the look of those 2-bit jagged blocks of color overlying the Text in the Button. The workaround is to "punch a hole" in the Sub-picture Highlight, so that it is hollow, where the Button's Text appears. This is done in PS, by using the "outline" of that Text to create a Mask for the Sub-picture Highlight. The jagged aspect can be adjusted a bit, by using a degree of Transparency (set in the non-Auto Color Set back in Encore). We still have a 2-bit color Sub-picture Highlight, and it still overlays the Button's Text, but now there is a hole in it, right where the Button's Text is located, and it is seen through that hole. The introduction of Transparency has the visual effect of "softening" the look of the 2-bit color, even though the jagged edges are still there - they just look softer. I went on to show how one could even use a second Sub-picture Highlight, that is just a bit larger than the first, and with more Transparency to simulate a "glow." Now, we cannot have a real "glow," because we are limited to that 2-bit color for the Sub-picture Highlight, but we can simulate it.
    Much of what a designer does is really slight of hand - illusion. They all have to work within the limitations of the DVD (or BD) specs., but with a bit of creativity, planning and some work in PS and Encore, they can create enough smoke and use enough mirrors to fool the user into believing that what they think they see skirt the DVD-specs. They do not, but that's where the illusion comes in.
    We get a lot of questions from people, who claim that one commercial DVD, or another, has full-color Sub-picture Highlights and they complain that Encore cannot do that - only 2-bit Sub-picture Highlights. What they are seeing, but do not realize it, is a dupe Menu, with a full-color graphic, and no real Sub-picture Highlight visible. Jeff gives full details on doing this. Same for those who have seen a Button with a duo-tone thumbnail, that turns full-color, when the Button is navigated to. Wow, how did they do that, and why can't Adobe Encore do that? Well, what they saw was a dupe Menu, with a full-color thumbnail and no visible real Sub-picture Highlight.
    Jeff shows how to create what appears to be at least a 3-color Sub-picture Highlight. It's really just 3 regular 2-bit color Sub-picture Highlights, with Masking to create the illusion that he beat the DVD-specs. Neat! [Being from the USA, I also liked that he used the US flag, but he could have chosen the French "Tri-color," or any other flag, without artwork.]
    These are all just tricks, but if the user buys into the illusion, who's to know?
    Enjoy,
    Hunt
    PS - though many of the great, older posts were lost, when the forum changeover happened, I strongly suggest reading the posts here. You can bypass ones that do not offer you anything, but almost every possible illusion has been discussed at least one time, and likely many, with some different workflows offered by those, who replied. Great reading.

  • How to create a bootable clone?

    So, I'm returning after a while in Mac-land, and there's one thing I'm missing that the Mac got very right. There were several apps that would easily clone your system onto a backup disk and make it bootable. It was the best backup system I ever had. If my disk died, I just rebooted onto the other one, and when I got the replacement, I used basically the same process to do the restore.
    How can I accomplish this in Arch? The "dd the disk" method isn't going to work out to well, as I need support for disks of different sizes, partition layouts, and interfaces. Rsync seems promising, but there's a fair bit of work to do after the copy since things like FS UUIDs will be different.
    The way this works on Mac is basically like this:
    1. rsync the source to the destination, excluding a few things that are useless, as recommended by Apple.
    2. Make the clone bootable. This is easy on Mac as boot code is never written outside the root FS, and doesn't even need to be installed into the FS header - all that has to happen is that the inode number of the boot code is written to a specific spot in the HFS+ header.
    3. The Mac's firmware (either PPC OpenBoot or X86 EFI) will scan all attached disks for bootable filesystems and show a list for you to pick, when interrupted with the right key.
    4. The root FS is always the boot FS, which eliminates the need for configuring the root FS in the boot code on fstab. It just mounts whatever it booted from as root. This neatly eliminates the need to post-edit these files after a clone
    As I see it, the difficulty of automating this process in Linux really has a lot to do with the lameness of the PC BIOS.
    I don't want to roll my own cloning code. Backups are too important to trust it to the kind of dirty hack I'd come up with. What can I use?

    So, I feel I have to respond somehow to this, so as not to seem ungrateful for the nice responses, but none of these answer the question I actually have. I think the typical Arch-user's DIY attitude goes a bit too far, sometimes.
    I know how to copy the files over, how to change the UUIDs, how to install GRUB, and how to create the 3 magic device nodes (null, console, and zero, for future reference). Just about any of these suggestions would be fine for a one-time or once-in-a-while process, but I want something that's painless enough to use as a daily backup routine. There's also the problem that they don't handle well the case where I don't want to take over the entire backup disk, and especially don't handle odd cases such as GPT disk format, where you shouldn't install boot code into the partition table area. They also aren't designed for the case where the backup device is an external disk which isn't intended to be remounted internally when disaster strikes, or the case of laptops where you don't want to have to remove /dev/sda from your machine to test.
    Basically, it amazes me that apparently nobody has written software yet to automate what's probably a very common desire. Google didn't find anything of the sort, so I came here to ask actual human beings. (Yet another case where Google is not wrong )
    Where I'm at now is to rsync everything and create the 3 device nodes, and then stop. This gets me to the 90% mark, is simple enough to be foolproof, and makes restoring the same as backing up. If there's no professional-feeling way to do the rest, I'll stop there.
    None of this post is intended sarcastically, and please don't take offense at my laundry-list of complaints for the suggestions given. I think my posts could stand to be a little clearer if a paid sysadmin with 11 years of Linux background can gather responses that say things like "use cp" and "DONT USE THIS COMMAND UNLESS YOU KNOW WHAT YOU ARE DOING"

Maybe you are looking for

  • Flex with JAVA - Query?

    Dear Experts, I would like to develop one small CRM Product using JAVA Programming Language, However which concepts of Java to be used for development is still on it's way to Identify. recently I heared of Adobe Flex concept and have done enough rese

  • Bad Support

    Post Author: powerneet CA Forum: Other Why isn't there any answers on questions asked by people here. I think i see by 10% of the postings a reply. I Think this is a very bad support forum. Please operator correct me if i am wrong. alwin

  • Dispaly PO and Street in an address node

    Hi Gurus, I am creating an adobe non-interactive form. I want to display an adderss with both Street and PObox. For that I am using an address node.If I give "POBOX has priority", only POBOX is displayed.If I give "STREET has priority", only street i

  • Validate() works very slowly with jse 1.4.2.

    Hi, I have a question about the method validate(). I really appreciate it if somebody could help me out. I have some components (buttons, textfields etc) in a panel. Let me refer it as Panel A. When I click one of the buttons in Panel A, I would like

  • Printing to PDF - Format A1 with ArchiCAD

    I cannot seem to print to PDF larger than A3. I have added a custom paper size (A1) and also tried installing the drivers for an HP Plotter. But regardless each time I try to save my layout from ArchiCAD 10 I can only save as A3 pdf. Any help would b