I need a script, is it possible?

Hello all,
     I need a script that does the following.
I select an object in AI CS3 and then execute the script.
1st. The script takes the object and fills it with 100% magenta and makes it a spot color named CC.
2nd. The script then resizes the document to 1" larger than the selected object and centers all art in the middle of the art board,. (so if the object is 10.5" x 15.7" the document setup size is changed to 11.5" x 16.7")
3rd. The script then stores the size of the selected object and the new resize of the document setup on the clipboard. So if I paste into notepad it would paste "10.5 X 15.7 - 11.5 X 16.7"
That is it, it does not need to be exact on the pasting syntax but close if you know what I mean. This will be used in a production environment so a hot key to execute the script would be nice.
If I can get help with this it would be awesome, Please let me know if you can help.
Anton

there you go
var doc = app.activeDocument;
var sel = doc.selection;
var doc2 = null;
for(j= sel.length - 1; j>= 0; j--) {
    var spotty = new SpotColor();
    spotty.tint = 100;
    var spottyColor = new CMYKColor();
    spottyColor.magenta = 100;
    spotty.spot = doc.spots.add();
    spotty.spot.colorType = ColorModel.SPOT;
    spotty.spot.name = "CC";
    spotty.spot.color = spottyColor;
    sel[j].fillColor = spotty;
    sel[j].name = "##REFERENCE";
    var nInc = new UnitValue(1, "in");
    var cWidth = new UnitValue(sel[j].width, "pt");   
    var cHeight = new UnitValue(sel[j].height, "pt");
    doc2 = app.documents.add(DocumentColorSpace.CMYK, cWidth + nInc.as("pt"), cHeight.value + nInc.as("pt"), 1);
    var newSel = sel[j].duplicate(doc2);
    var nTL = parseFloat((nInc.as("pt") / 2));
    var nTop = cHeight.value + nTL;
    newSel.position = [nTL, nTop];
    grabAndCenterObjects();
    var txtFrm = doc2.textFrames.add();
    txtFrm.contents = "Old dimensions: " + cWidth.as("in").toFixed(2) + " X " + cHeight.as("in").toFixed(2) + "\" New dimensions:" + (cWidth.as("in")+1).toFixed(2) + " X " + (cHeight.as("in")+1).toFixed(2) + "\"";
    doc2.selection = null;
    txtFrm.selected = true;
    app.copy();
    txtFrm.remove();
function grabAndCenterObjects(ignorePath) {
    for(j = doc.pageItems.length - 1; j >= 0; j--) {
        if(doc.pageItems[j].name.indexOf("##REFERENCE") > -1) continue;
        var mElem = doc.pageItems[j].duplicate(doc2);
        var left = (doc.pageItems[j].width > doc2.width) ? -(doc.pageItems[j].width - doc2.width) / 2 : (doc2.width - doc.pageItems[j].width) / 2;
        var top = (doc.pageItems[j].height > doc2.height) ? (doc.pageItems[j].height + (doc.pageItems[j].height - doc2.height)/2) : (doc.pageItems[j].height + (doc2.height - doc.pageItems[j].height)/2);
        mElem.position = [left, top];
hope it helps;
cheers;

Similar Messages

  • I have a iMac 21,5" Intel mid 2011 and I need to know if is possible I change the original 500Gb HD for a 512Gb SSD? If yes, where I find a tutorial about this? Thanks a lot and best regards all.

    Hi people,
    I'm typing from Brasil, sorry my English.
    I have a iMac 21,5" Intel mid 2011 and I need to know if is possible I change the original 500Gb HD for a 512Gb SSD?
    I intend to keep the original DVD driver and install the SSD in the same HD place.
    If yes, where I find a tutorial about this?
    And I will like to know if the 512GB Solid-State Drive Kit for Mac Pro is compatible with iMac.
    http://store.apple.com/us/product/MC731ZM/A/512gb-solid-state-drive-kit-for-mac- pro?fnode=5f
    What brand and model of SSD do you recommend?
    Thanks a lot for now and best regards all.
    Carlos Sgrillo
    Porto Alegre, RS, Brasil

    Tukaine
    Sep 23, 2012 10:59 PM
    Since the late 2009 iMacs came out, replacing the hard drive has caused the internal Hard Drive Fan to start running at around 6000RPM.
    This is due to Apple replacing the external Hard Drive temperature sensor with a proprietary firmware and using the drives internal sensor.
    Replacement drives do not contain the firmware to deliver temperature data on the temperature sensor cable.
    When the iMac does not receive a good signal from the hard drive it puts the fan at full speed to protect the drive.
    If you replace your drive, your iMac will initially seem fine, but soon the fan will begin to speed up to full speed. Resetting the SMC (System Management Controller) will have a temporary effect, but again the fan will speed up.
    Fixes people have used in the past included:
    Using smcFanControl and the terminal to set a MAX speed for the fan and writing scripts to start this after every sleep/restart.
    Shorting the temperature sensor cable (Not a possibility on 2011 iMacs) this tricks the iMac into thinking the drives temperature is very low, hence slow fan speed.
    Both these fixes are less then perfect and leave the drive in a dangerous situation with no protection from overheating.
    Another option people try is other Fan Control software. These programs will not work for this particular issue as they often only control the base speed, and if they do control the fans actual speed they rely on the temperature reported by the sensor which is now incorrect.
    HDD Fan Control
    HDD Fan Control works to fix this issue by reading the drives internal temperature using the S.M.A.R.T protocol and set the fans actual speed to a value good to protect the drive.
    It runs at startup and continually to always control the fan correctly, prevent the loud fan noise and protect the drive from overheating
    Instead of HDDFan Control, get the free SSDFan Control
    http://exirion.net/ssdfanctrl/

  • I need new pc. is it possible to instal Photoshop CC again ? How often can I install?

    I need new pc. is it possible to instal Photoshop CC again ? How often can I install?

    Moineauhh you can install and utilize your Creative Cloud Membership on up to two computers.  You can find more details regarding the installation process at Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html.

  • Need java script 6.26 to use banking software keep getting "the connection was reset" error Java appears on addon blocked list

    I am trying to use Team One Credit Unions CU@home to access my accounts. Their support team tells me I need Java script 6.26. I show that on my add on list but it also states Java is blocked on the blocked software list. How do I get Java script running so I can do my home banking or at least test it to be sure that is the issue. I have tried running this program with Java enabled and disabled with the same results.

    To avoid confusion: http://kb.mozillazine.org/JavaScript_is_not_Java
    See:
    * http://kb.mozillazine.org/Java
    * http://kb.mozillazine.org/JavaScript
    Java 6 U26 is about the Java plugin.
    You can see in "Tools > Add-ons > Plugins" if the Java plugin is installed and also on the about:plugins page via the location bar.
    * http://www.java.com/en/download/help/testvm.xml - How do I test whether Java is working on my computer? - 1.4.2_xx, 1.5.0, 6.0

  • Need help - need a script

    Hi All,
    I have no knowledge of applescript and need something made to meet a deadline. I am a graphic artist for the national office of a non-profit with 400 agencies.
    I need a script to control adobe illustrator to make customized logo packages for all of the agencies. I have 5 base documents. There are multiple logos per document. The text is set as "aaa" that needs to be customized. I am doing a find and replace to insert the text. Each file also has a 'tagline' layer that gets turned off and saved that way also.(a PNG) One master file gets saved as an illustrator PDF.
    I need the script to ask me what the agency number is and also what the agency name is and make/name a new folder and then process the logos in illustrator saving the files in the new folder.
    They needed to be completed yesterday, but it takes me roughly 10 to 15 minutes to do one agency. I have no time to work on them during the day a all so I am pretty deserate. We have no budget for this, but I am willing to pay $50 or so out of my own pocket(sorry... recently had twins so I'm broke too)
    Please contact me at [email protected] if you could do this.

    Hi jasonschaeffer
    try here
    http://macfreelancer.com/
    Budgie

  • I need a script to invert the page order of selected pages for cs5.

    Hello,
    I am a graphic designer and i am trying to create a easier way to make multiple page folders, By using the multiple page size feature in inDesign CS5. But my problem is that i can create the front side of the folder easier than before, the backside is my problem I need to inverse the page order manual, this creates a lot of mistakes and errors along the way. Thats why I need a script to invert the page order of the pages I select. I hope to hear from someone soon.
    My best regards,
    Gijs van Roij

    In /gateprd/ARCHIVE/*.arc
    This is the script to remove the archives after it has been backup by the netbackup policy named Archive. This policy removes the archives that have been backed up.
    /home/oracle/dba/scripts> more rmovarch.sh
    #!/bin/ksh
    # compress /gateprd/ARCHIVE/*.arc
    find /gateprd/ARCHIVE/*.arc -type f ! -exec echo {} > /home/oracl
    e/dba/lists/ARCHIVElist \;
    if test $(cat /home/oracle/dba/lists/ARCHIVElist|wc -l) -gt 0
    then
    echo "Hay archives. Se corre script de borrar"
    /home/oracle/dba/scripts/ARCHIVE_BACKUP.sh ARCHIVE
    else
    echo "No archives!!"
    fi

  • I need a script that copies the filename into the file

    I need a script that copies the filename into 4th column of each line in the text doc file.
    I have over 2000 different file names each containing 6 columns and ~50-100 rows.
    I can do this manually using this script:
    awk '{print $1"\t"$2"t\"$3"\t <name> \t"$6}'
    But I would like an automation command or script. Is there any command that I can use instead of <name> that will copy the filename into the column?
    Thanks
    Monica

    Oops, I forgot the redirect to a file. It's not a good idea to edit files in place. A script could fail and you're left with at least one file ruined. It's better to create new files then delete the old files.
    for file in *; do
        while read col1 col2 col3 col4 col5 col6; do              
            printf "%s\t%s\t%s\t%s\t%s\n" $col1 $col2 $col3 $file $col6
        done < $file > n$file
    done
    You could narrow the files listed such as
    for file in *.tsv
    and redirect the new files to another directory. Such as
    done < $file > /absolute/path/to/directory/$file

  • Need a script to move files to folders

    Hi guys.  I have found a lot of similar threads but not something exactly like what I need.
    I have a ton of files that need to be sorted into folders of the same name.  I found scripts to help me with that however, I have some variations on the files with an extension to the file name that also need to be moved into the same folders.
    For instance, I have a folder named....
    spiegal_case_25_video_3
    and I have the following files that all need to be moved into that folder....
    spiegal_case_25_video_3.mp4
    spiegal_case_25_video_3.webmsd.webm
    spiegal_case_25_video_3_h.flv
    spiegal_case_25_video_3_m.flv
    spiegal_case_25_video_3_l.flv
    I have found scripts to get me part of the way there but I can't get the FLVs into the folders because of the _h _m and _l extensions on the file names.  Is there a way to move these files into their appropriate folders (maybe by ignoring the last 2 characters in the file name?)
    I have also found a script that will read everything up to the underscore, but that won't help since the file names have multiple underscores.  So I really need a script that can do the sorting while ignoring the last 2 characters in the file name.
    Can anyone help me out?  I'm not very script savvy.
    Thanks!

    I've tested the following script (under OS X 10.8.5) with 4 subfolders and 20 files, all located in a folder called "Master folder" located in a USB flash drive named "EXT_DRIVE". It seems to work flawlessly. In its present state, the script will replace any file already located in any of the subfolders.
    set theMasterFolder to POSIX file "/Volumes/EXT_DRIVE/Master folder"
    tell application "Finder"
        activate
        set theFolders to (folders of folder theMasterFolder) as alias list
        repeat with thisFolder in theFolders
            set thisName to name of thisFolder
            move (files of folder theMasterFolder whose name begins with thisName) to thisFolder with replacing
        end repeat
    end tell

  • Need a script to enable in-place hold on Office 365

    Hello, I need a script to enable in-place hold on Office 365 for my users.
    The options that I have found for this so far is to enable in-place hold for a DL or an individual user. Is there a way to use a CSV instead?
    This is what I have used before.....where "allstaff" is the name of a DL.
    New-MailboxSearch -name "3 Year In-Place Hold" -SourceMailboxes allstaff -InPlaceHoldEnabled $true -ItemHoldPeriod 1095

    That doesn't seem to work.........I think it's trying to create a new hold query for every user.
    PS C:\scripts> ./user_hold.ps1
    WARNING: The hold setting may take up to 60 minutes to take effect.
    Name                CreatedBy           InPlaceHoldEnabled  Status
    3 Year In-Place ... S-1-5-21-2495351... True                NotStarted
    Unable to execute the task. Reason: A mailbox search named <3 Year In-Place Hol
    d> already exists or is currently being deleted. Please choose a different name
        + CategoryInfo          : InvalidArgument: (Microsoft.Excha...DiscoverySea
       rch:MailboxDiscoverySearch) [], MailboxSearchTaskException
        + FullyQualifiedErrorId : [Server=BLUPR06MB097,RequestId=e8df9b95-2e00-428
       d-813f-da05ea8d09d4,TimeStamp=11/5/2013 9:38:05 PM] [FailureCategory=Cmdle
      t-MailboxSearchTaskException] 95CD9ECA
    So my next question...........how do I add users to an existing In-Place hold?

  • I need a script that will find the computer a user last logged into.

    I am still learning scripting, I need a script that will allow me to pull in usernames from a csv file. Find what computer they last logged into and output that to an csv file.
    I have looked all over and can't find exactly what I need.
     I found the following script but I need  to add the resuitsize unlimited but can not figure out where to put it we have a large environment. Also I need to be able to grab username from a csv file. Any assistance you can provide is appreciated.
    ##  Find out what computers a user is logged into on your domain by running the script
    ##  and entering in the requested logon id for the user.
    ##  This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ##  snapin  http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null){
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username}
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null){
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username}
    get-username resultsize unlimited
    $computers = Get-QADComputer | where {$_.accountisdisabled -eq $false}
    foreach ($comp in $computers)
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
      $Reply = $null
      $Reply = $ping.send($Computer)
      if($Reply.status -like 'Success'){
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username){
    write-host "$Username is logged on $Computer"

    If you are querying by user "resultset size" will be of no use.
    You also have functions that are never used and the body code doe snot look for users.
    Here is what you scrip looks like if printed well.  It is just a jumble of pasted together and unrelated items.
    ## Find out what computers a user is logged into on your domain by running the script
    ## and entering in the requested logon id for the user.
    ## This script requires the free Quest ActiveRoles Management Shell for Active Directory
    ## snapin http://www.quest.com/powershell/activeroles-server.aspx
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    $ErrorActionPreference = "SilentlyContinue"
    # Retrieve Username to search for, error checks to make sure the username
    # is not blank and that it exists in Active Directory
    Function Get-Username {
    $Global:Username = Read-Host "Enter username you want to search for"
    if ($Username -eq $null) {
    Write-Host "Username cannot be blank, please re-enter username!!!!!"
    Get-Username
    $UserCheck = Get-QADUser -SamAccountName $Username
    if ($UserCheck -eq $null) {
    Write-Host "Invalid username, please verify this is the logon id for the account"
    Get-Username
    get-username resultsize unlimited
    $computers = Get-QADComputer | where { $_.accountisdisabled -eq $false }
    foreach ($comp in $computers) {
    $Computer = $comp.Name
    $ping = new-object System.Net.NetworkInformation.Ping
    $Reply = $null
    $Reply = $ping.send($Computer)
    if ($Reply.status -like 'Success') {
    #Get explorer.exe processes
    $proc = gwmi win32_process -computer $Computer -Filter "Name = 'explorer.exe'"
    #Search collection of processes for username
    ForEach ($p in $proc) {
    $temp = ($p.GetOwner()).User
    if ($temp -eq $Username) {
    write-host "$Username is logged on $Computer"
    I suggest finding the original code then use the learning link at the top of this page to help you understand how it works in Powershell.
    ¯\_(ツ)_/¯

  • I need a script edited so it will enter the intiger a specified number.

    This is a number generating script created by Michel Lemieux and posted here: http://www.quark.com/service/forums/viewtopic.php?t=4176 I need this script to ask for data that would specify the number of times each number should be added to the file. IE: the return data in the created file would look like this if 2 was entered: 1<\b>1<\b>2<\b>2<\b>3<\b>3<\b>4<\b>4<\b>

    Hello
    It is often easier to write a code anew than to edit an existing one...
    Try somethnig like this. This will handle both integer and non-integer numbers for series along with your requirement on iteration count of each number.
    Cheers.
    H
    -- SCRIPT
    main()
    on main()
    set mss1 to "Enter i, j, k, r, separated by space, where -
        i = start number
        j = end number
        k = increment  (k ≠ 0 AND (i - j) * k <= 0)
        r = repetition count  (r >= 1)"
    set mss2 to "Where to save the result?"
    set errs1 to "Parameter error."
    repeat
    set t to text returned of (display dialog mss1 default answer "1 100 1 1")
    try
    set tt to {}
    repeat with t in text2list(t, space)
    set t to t's contents
    if t is not "" then
    set end of tt to t as number
    end if
    end repeat
    set {i, j, k, r} to tt
    set r to r as integer
    if (r < 1) or (k = 0) or ((i - j) * k > 0) then
    display dialog errs1 with icon 2
    error number 8000
    end if
    exit repeat
    on error number errn
    if errn = -128 then error number -128 -- user cancel
    end try
    end repeat
    --return {i, j, k, r}
    set nn to {}
    repeat until (i - j) * k > 0
    repeat r times
    set end of nn to i
    end repeat
    set i to i + k
    end repeat
    set t to list2text(nn, "<\\b>")
    --return t
    set f to choose file name with prompt mss2 default name "*.xtg"
    writeData("" & f, t, {_append:false})
    return {nn, t}
    end main
    on list2text(aa, delim)
      list aa : source list
      text delim : text item delimiter in list-text conversion
    local t, astid, astid0
    set astid to a reference to AppleScript's text item delimiters
    try
    set astid0 to astid's contents
    set astid's contents to {delim}
    set t to "" & aa
    set astid's contents to astid0
    on error errs number errn
    set astid's contents to astid0
    error "list2text(): " & errs number errn
    end try
    return t
    end list2text
    on text2list(t, delim)
      text t : source text
      text delim : text item delimiter in text-list conversion
    local tt, astid, astid0
    set astid to a reference to AppleScript's text item delimiters
    try
    set astid0 to astid's contents
    set astid's contents to {delim}
    set tt to t's text items
    set astid's contents to astid0
    on error errs number errn
    set astid's contents to astid0
    error "text2list(): " & errs number errn
    end try
    return tt
    end text2list
    on writeData(fp, x, {append:append})
      text fp: output file path
      data x: anything to be written to output file
      boolean _append: true to append data, false to replace data
    local a
    try
    open for access (file fp) with write permission
    set a to fp as alias
    if not _append then set eof a to 0
    write x to a starting at eof
    close access a
    on error errs number errn
    try
    close access file fp
    on error --
    end try
    error "writeData(): " & errs number errn
    end try
    end writeData
    -- END OF SCRIPT
      Mac OS 9.1.x  

  • Need VB script for getting the IIS certification information

    Hi guys,
    I have totally 1000 IIS servers  2003 & 2008
    windows and some of the  servers configured
    IIS 3rd party Security certificates. I need a script to get the certification information like expiry date & certificate vendor name.
    Regards,
    SreeM

    Post here:http://forums.iis.net/
    Look in Gallery for IIS scripts:http://gallery.technet.microsoft.com/
    ¯\_(ツ)_/¯

  • I need a script to merge two particular layers

    I need a script to merge two particular layers.They always are named the same.

    What's your budget.

  • HT204150 is it possible to retrive a stored contact once its been deleted from your iphone? i deleted a number from my phone like 2-3 months ago and now i need it back. is it possible to retrive this contact or either view my past call log from around the

    is it possible to retrive or download a number/contact after its been deleted from your iphone? i deleted a number about 2-3 months ago and
    now i really need it back. is it possible to retrieve this number or maybe view or bring up my entire or past call log which would have this numer in it?

    If it's not on icloud.com any longer you can't restore it from iCloud.  (Contacts are only synced to your iCloud account, and are not included in the iCloud backup.)

  • Need help scripting a sliding volume scale.

    Hi, I hope this is in the right section, I am trying to make
    a flash flv player (sort of like youtube) for my site. I have it
    practically done but need a better volume adjustment. Currently, I
    have only been able to figure out how to make a sound on/off button
    but what I would really like is the volume control found on this
    player.
    http://www.jeroenwijering.com/?item=JW_Media_Player
    Could someone please help me with the script for it? I am
    really new to flash but I made the following 3 objects in the
    library. Solid black graphic in to a movie object, 1 solid black
    graphic in to a button, and one light grey graphic in to a button.
    I assume I need a script for each of those 3 objects. Thanks for
    the help!
    P.S. Using Adobe Flash CS3 Trial

    you need to submit it to another file which in turn will
    insert the information on the fold field using SQL. for example...
    INSERT INTO contact
    VALUES FORM.Firstname, FORM.LastName, FORM.Phone
    I don't know what programming code you are using (Coldfusion,
    PHP, ASP ..etc).
    Here's more information.
    http://www.w3schools.com/sql/sql_insert.asp

Maybe you are looking for

  • Why does iPhoto Screen Saver say "The selected source contains no pictures"?

    After upgrading to Lion, I noticed that I can no longer use iPhoto albums as a screen saver. At first when loading the Screen Saver preference page, the iPhoto Screen Saver doesn't show up at all. After a bit, I can see "iPhoto" as an option, but if

  • Block/Restrict access request page on CUP

    Hi All, I've an interesting requirement. We use a CUP 5.3 SP7. We would be using the IDM webservices to create access requests to CUP and we want all our requests to be initiated ONLY through our IDM solution. Is there a way we can restrict the /AE/i

  • Change sender WF-BATCH in campaign automation

    Hello. Within Campaign Automation process the sender of the generated e-mails is always WF-BATCH. It overwrites the settings from the campaign element where I specified a sender and an email address. I tried to adjust the name with SU01 by filling in

  • SOAP Server - HTTP GET

    Good afternoon, I'm trying to test my class: public String getOperation(String methodName, String[] paramNames, Object[] paramValues) throws Exception int size = 0;           int i = 0;           // Crear el stub cuando no exista           if (!estad

  • Email submit button does nothing

    I've added the button to a dynamic form, and I gave it a caption and a target email address and a subject. When I click on it the Object pallate's Caption field may or may not be grayed out, unless I right-click on the button and select Palettes>Obje