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.

Similar Messages

  • How to make SAP B1 connection with Windows Sharepoint Service 3.0

    how to make SAP B1 connection with Windows Sharepoint Service 3.0 through asp.net web part code.. I get the security error when i run that web part......
    public bool ConnectToCompany()
                oCompany = new SAPbobsCOM.Company();
                oCompany.Server = "192.168.1.58";
                oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005;
                oCompany.CompanyDB = "SBODemoUS";
                oCompany.DbUserName = "sa";
                oCompany.DbPassword = "abc";
                //oCompany.UseTrusted = true;
                oCompany.UserName = "manager";
                oCompany.Password = "manager";
                oCompany.language = SAPbobsCOM.BoSuppLangs.ln_English;
                oCompany.LicenseServer = "192.168.1.58:30000";
                int i = oCompany.Connect();
                if (i != 0)
                    return false;
                return true;
    protected override void RenderContents(HtmlTextWriter writer)
                if (conn.ConnectToCompany() == true)
                    writer.Write("Hello" + this.Context.User.Identity.Name);
    Edited by: bikalg on Nov 28, 2010 9:43 AM

    Hi.......
    Welcome to SAP Business One Forum.....
    Unfortunately this is the wrong forum you posted here.
    I would suggest you post it in SDK or System Administration Forum and definitely you get the solution and close this thread from here......
    Regards,
    Rahul

  • How to make a PDF form with expanding tabel or expanding fields, like in Word.

    How to make a PDF form with expanding tabel or expanding fields, like in Word.

    This is currently not possible in Formscentral. It is something we are working on for the future. Please stay tuned.
    Andrew Yarborough

  • Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now ?

    Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now that they do not have the spry option?

    bbull2005 wrote:
    Preran, why wouldn't Dreamweaver include it's own menu/navigation bar widget?
    I can't answer on Preran's or Adobe's behalf, but I think you'll find at least part of the answer here: http://wiki.jqueryui.com/w/page/38666403/Menubar
    Adobe decided to discontinue development of Spry in August last year, and Dreamweaver CC made the switch to using jQuery UI widgets and effects. One reason for dropping Spry was that it failed to work correctly in some browsers. Judging from the fact that the jQuery UI menubar is now "on ice", creating a flyout menu that works reliably across all devices is proving more difficult than originally envisaged.
    Because all other widgets in Dreamweaver CC use jQuery UI, it's a reasonable assumption that Adobe hoped the jQuery UI menubar would be ready in time, but it wasn't.

  • How to create  a test plan with specific transactions (or program)

    Hello,
    I'm a new user in Sol Man !
    How to create  a test plan with specific transactions (or program).
    In my Business Blueprint (SOLAR01) I've created in 'transaction tab' the name of my specific transactions and linked it.
    In my test plan (STWB_2) those specific doesn't appear to be selected !
    Thanks in advance.
    Georges HUYNEN

    Hi 
    In solar01 you have defined but you have to assign the test case in solar02 for this test case in the test cases tab.
    When you do so expand the business sceanario node in test plan generation of STWB_2 transaction and now that will appear.
    Also visit my weblog
    /people/community.user/blog/2006/12/07/organize-and-perform-testing-using-solution-manager
    please reward points.

  • How to make a function take a specific group of constants

    I know i asked this before, maybe a year ago, but I totally forgot how to do it, and I haven't been programming much lately. But I was wondering if somebody can tell me how to make a certain function take specific constants. For example there are java functions, of which I can not remember that will only take certain values. So the function might look like:
    public getInfo(String INFONAME){}Where INFONAME has to be like one of two names or something, and they are constants that are defined somewhere else. If anybody knows what I mean by this, and knows how to create functions like that please let me know. Thank you.

    here's an overkill,
    import java.util.*;
    abstract class DoWhatever {
        public static Hashtable ht = null;
        public static Object DoWhat( String s, Object obj ) {
         if( null == ht ) {
             ht = new Hashtable();
             ht.put( ThisDoWhatever.NAME, new ThisDoWhatever() );
             ht.put( ThatDoWhatever.NAME, new ThatDoWhatever() );        
         return ( (DoWhatever) ht.get( s ) ).doWhatever( obj );
        public abstract Object doWhatever( Object obj );
    class ThisDoWhatever extends DoWhatever {
        public final static String NAME = "this";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    class ThatDoWhatever extends DoWhatever {
        public final static String NAME = "that";
        public Object doWhatever( Object obj ) {
         System.out.println( NAME );
         return null;
    public class DoThisOrThat {
        public static void main( String[] args ) {
         DoWhatever.DoWhat( args[ 0 ], null );
    }

  • How to configure the wifi access with specific time slot for kids?

    how to configure the wifi access with specific time slot for kids?

    Which model of AirPort base station do you have? Which version of OS X is your MacBook Pro running?
    Wi-Fi access can be limited using the Timed Access feature of the AirPort routers. You would do so using the AirPort Utility.

  • How to make the wifi connection with Ipad in china since it requires user's name and password.

    How to make the wifi connection with Ipad in china since it requires user's name and password just like the dialed-up?

    The same way you would connect to a secure wifi network in any other country. Supply the username and password when prompted.

  • HT4642 ios numbers:how to make cell height variable with auto line brake setting ?

    ipad numbers; How to make cell height variable with auto line break setting?

    That's strange. I responded earlier and the whole message got trashed. Hence the test post before retyping the entire thing again.
    Thanks for the reply.
    The video clip is a single screen capture video clip. This is what I've found by playing around with this more.
    The original clip resolution is greater than 640x480. If I use QT Pro to convert the original clip to 640x480 and then use either Flip4Mac or PE7, then the resolution looks good.
    Just trying to figure out if should keep all workflow on the MacOS side. There are several different version of Flip4Mac. $49 gives me 640x480, but if I ever want to make it slightly larger then I would need to go with the $99 or HD version.
    I also tried to export to AVI with QT Pro and the import with Windows MovieMaker but it didn't work really good. I liked the simplicity (since PE7 hogs a lot of resources especially through VMWare).

  • How to make Dynamically Shortened Text With "Show More"

    Hi there! i want to know how to make dynamically shortened text with show more or read more in my website using HTML 5 pages  or ASP.NET ?
    example like these paragraphs 
    Lorem Ipsum är en utfyllnadstext från tryck- och förlagsindustrin. Lorem ipsum har varit standard ända sedan 1500-talet, när en okänd boksättare tog att antal bokstäver och blandade dem för att göra ett provexemplar av en bok. Lorem ipsum har inte bara överlevt fem århundraden, utan även övergången till elektronisk typografi utan större förändringar. Det blev allmänt känt på 1960-talet i samband med lanseringen av Letraset-ark med avsnitt av Lorem Ipsum, och senare med mjukvaror som Aldus PageMaker.
    Det är ett välkänt faktum att läsare distraheras av läsbar text på en sida när man skall studera layouten. Poängen med Lorem Ipsum är att det ger ett normalt ordflöde, till skillnad från "Text här, Text här", och ger intryck av att vara läsbar text. Många publiseringprogram och webbutvecklare använder Lorem Ipsum som test-text, och en sökning efter "Lorem Ipsum" avslöjar många webbsidor under uteckling. Olika versioner har dykt upp under åren, ibland av olyckshändelse, ibland med flit (mer eller mindre humoristiska).
    I motsättning till vad många tror, är inte Lorem Ipsum slumvisa ord. Det har sina rötter i ett stycke klassiskt litteratur på latin från 45 år före år 0, och är alltså över 2000 år gammalt. Richard McClintock, en professor i latin på Hampden-Sydney College i Virginia, översatte ett av de mer ovanliga orden, consectetur, från ett stycke Lorem Ipsum och fann dess ursprung genom att studera användningen av dessa ord i klassisk litteratur. Lorem Ipsum kommer från styckena 1.10.32 och 1.10.33 av "de Finibus Bonorum et Malorum" (Ytterligheterna av ont och gott) av Cicero, skriven 45 före år 0. Boken är en avhandling i teorier om etik, och var väldigt populär under renäsanssen. Den inledande meningen i Lorem Ipsum, "Lorem Ipsum dolor sit amet...", kommer från stycke 1.10.32.
    Den ursprungliga Lorem Ipsum-texten från 1500-talet är återgiven nedan för de intresserade. Styckena 1.10.32 och 1.10.33 från "de Finibus Bonorum et Malorum" av Cicero hittar du också i deras originala form, åtföljda av de engelska översättningarna av H. Rackham från 1914.

    Moved to the main Dreamweaver support forum.
    There are several ways you could approach this. Here's one you might try:
    Give the first paragraph an ID, such as "first", and wrap the paragraphs you want to hide in a <div> with another ID, such as "more". Then add the following block of JavaScript just before the closing </body> tag of the page:
    <script>
    var first = document.getElementById('first'),
         more = document.getElementById('more'),
         trigger = document.createElement('span');
    trigger.id = 'trigger';
    trigger.innerHTML = 'Show less';
    first.appendChild(trigger);
    function toggleDiv() {
      var state = more.className,
           text = trigger.innerHTML;
      more.className = (state == 'open') ? 'closed' : 'open';
      trigger.innerHTML = (text == 'Show more') ? 'Show less' : 'Show more';
    toggleDiv();
    if (trigger.addEventListener) {
        trigger.addEventListener('click', toggleDiv, false);
    } else if (trigger.attachEvent) {
      trigger.attachEvent('onclick', toggleDiv);
    } else {
      trigger.onclick = toggleDiv;
    </script>
    This gets references to the "first" paragraph and the "more" <div>. It also creates a <span> with the ID "trigger" that's appended to the "first" paragraph. The rest of the script defines a function called toggleDiv(), which toggles the "more" <div> open and closed, and changes the text in the "trigger" <span>.
    You also need to create the following style rules for the various elements:
    <style>
    #trigger {
        text-decoration: underline;
        color: blue;
        cursor: pointer;
    #more {
        transition: ease-out .7s;
        overflow: hidden;
    #more p:first-child {
        margin-top: 0;
    #more.closed {
        height: 0;
        -webkit-transform: translateY(-600px);
        transform: translateY(-600px);
    #more.open {
        -webkit-transform: translateY(0);
        transform: translateY(0);
        max-height: 600px;
    #more + p {
        margin-top: 0;
    </style>
    This solution hides the text and creates the "trigger" <span> only if JavaScript is enabled in the browser. It should work in all browsers, including Internet Explorer 8 and earlier.

  • My 3gs wont restore after ios 5 update. I have tried firmware restore and restore from backup, neither works. All I get is "iphone restore failed because backup session failed" Any ideas on how to make a successful restore with this ios 5 update?

    My 3gs wont restore after ios 5 update. I have tried firmware restore and restore from backup, neither works. All I get is "iphone restore failed because backup session failed" Any ideas on how to make a successful restore with this ios 5 update?

    I was having the same problem, I backed up my phone and then updated to iOS 5 and then it kept telling me it could not restore from my backup as it had failed.  After reading a bunch of forums and posts and trying everything, I did manage to get it to work.  I had tried the Time zone, creating a new computer user account, disabling anti-virus, etc.
    It took a combination of things, one of which was disabling the anti-virus completely and copying the contents of the backup folder to my desktop and then deleting everything in the backup folder.  Then I rebooted the PC, entirely disabled the anti-virus, copied the one backup I wanted to restore from the desktop to the backup folder and then trying to restore.  Low and behold the phone said restoring from backup and I am back in business, so when in doubt, trying combining some of the fixes together.

  • How to make Turnable PDF-Pages with flip effect

    Hi,
    can any one help me?
    How to make flipping the pages in a PDF file using Acrobat professional? And how to save as a PDF file and is it possible?
    Please advise me how to process this.
    Thanks & Regards,
    Sudhakar

    Some related information that may help.
    http://forums.adobe.com/thread/719674?tstart=0
    http://acrobatusers.com/content/page-turner-0
    Be well...

  • How to make an index in InDesign CC 2014.1 using a topics list?

    Hi all,
    I have read the long help document on how to make an index in InDesign CC 2014.1 using a topics list, and still can't work out what to do.
    I have done a 548 page book, using a document for each chapter, and a book file to put them all together in the right order.
    I now need to make an index at the back, as the author has many quotes throughout the book at the start of each chapter and section.
    I have a list of those people quoted and want to upload this list and get the index feature in InDesign to find all instances of the name occurring in the entire book.
    After reading the help document I still cannot work out how to do this.
    My questions are:
    1. Do you have to use an InDesign document as a source for the list of topics? If so, should the document be added to the book file or outside it?
    It seems a bit recursive to have the list of topics in an ID document that is in the book file.
    2. Once you have uploaded the topics into the Index feature, how do you get it to look for all instances of that 'topic' througout the entire book? I can't figure that out from the help documents. What do I select? Do I do it from the Index panel? Do I highlight the text in the source document? Not sure how to do this...
    3. I need the names to list surname first of the quoted authors in the index. This command seems to be different between various editions of ID. For ID CC 2014.1 is it ctrl+alt+shift+]
    4. To make the surname show first, what do I highlight? The topic? and then do ctrl+alt+shift+] and select find all as well? Or do I have to just go through the text and manually do this and ditch the idea of uploading topics first?
    I am confused as you can see and any help with this is appreciated.

    Sorry 007, I really thought you were posting a trick question as on the OCP tests.
    Anyway, as Justin mentioned, if you have an index on ename, it may be used when doing a comparison predicate statement with the ename value.
    What it depends on are several other things: stats, how many rows in the table, use of an index hint, etc.
    Rather than questioning the group on this, why not just turn on autotrace and run the query for the different scenarios.
    The output will show you if it used the index, number of rows returned, blocks read, etc.
    SQL> create table emp (ename  varchar2(40));
    Table created.
    SQL> insert into emp select username from sys.dba_users;
    25 rows created.
    SQL> commit;
    Commit complete.
    SQL> set autotrace on
    SQL> select * from emp where ename != 'SYSTEM';
    Execution Plan
    Plan hash value: 2951343571
    | Id  | Operation        | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |           |    24 |   528 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX FULL SCAN | ENAME_IDX |    24 |   528 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"<>'SYSTEM')As you can see, the above used an index, even though there were only 25 rows in the table.
    You can test each of your scenarios, one by one, including use of a hint.

  • In Pages how do I save a file with another name

    In Pages how do I save a file with another name?

    I don't know if there is a less cumbersome way to do this (I'm still pretty new to Lion) but This is what I do - since "Save As" seems to be gone with Lion.
    I create a duplicate document - then click the red button to close the document - and a dialog box pops up and asks if you want to save the changes - I change the name in there and then save the file under the new name.
    You can also save the copy to the desktop - get info - and then change the name if the finder window.
    I copied this from the Pages help area. These help instructions were created pre-Lion I'm sure.
    Saving a Copy of a Document
    If you want to make a copy of your document—to create a backup copy or multiple versions, for example—you can save the document using a different name or location. (You can also automate saving a backup version, as Automatically Saving a Backup Version of a Document describes.)
    To save a copy of a document: 
    Choose File > Save As and specify a name and location.
    The document with the new name remains open. To work with the previous version, choose File > Open Recent and choose the previous version from the submenu.

  • How to make iTunes read the song's name/singer from the file's name itself?

    Hi everyone,
    So I have this file with songs from everywhere. I spent quite some time now to make sure that the structure of each file's name is as such : "Singer - Song name", hoping that everything would be read by iTunes accordingly. However, either iTunes read it well, or it didn't read it at all ("Singer - Song name" appearing in Title alone), or iTunes read the "media" of the file (ie. what the guy I downloaded it from wrote for it in the Preferences, which usually is in capital letters or with a bunch of weird underscores). As I'm OCD and need everything to be neat, I'm highly tensed right now. I really want everything to be neat and clear!
    So, how do I make sure that iTunes reads the files' names such that it knows the structure is "Singer - Song name"? Thanks.

    iTunes doesn't use file names to determine how music appears in your library,  Rather, it uses metadata that is split between:
    data elements that are embedded within the media files
    data elements that are included in the entries in the iTunes database
    No amount of reorganization, renaming or other manipulation at the file level will make any difference to how songs will appear in iTunes.  Using your example:
    the value of the track number element is 1
    the value of the artist element is "Elvis Presley"
    the value of the song name element is "Blue Suede Shoes"
    Depending on how you configure iTunes then the file name is either:
    completely independent of iTunes (i.,e., the file containing this song could be xyz.mp3)
    dependent on the metadata managed by iTunes, (i.e., when you have these two options set:
    then iTunes will set the file name to be 1-01 Blue Suede Shoes.mp3 where:
    the file is in a folder called "Elvis Presley" (the name of the album)
    that folder is in one called "Elvis Presley" (the name of the artist) which is in iTunes Media\Music
    Going back to your question "How to make iTunes read the song's name/singer from the file's name" the answer is simple - you can't, as this is not how iTunes works.  There are some third-party utilities that you can use to set some metadata element values based on parsing of file names which might be a useful first step.  However, to use iTunes effectively you should really forget about / ignore file names - manage your media using appropriate metadata and allow iTunes to look after file names behind the scenes.

Maybe you are looking for

  • Problem with subscript and superscript in tables when exporting in .pdf

    When I put some words in superscript (or subscript) in a table, a bug occurs when exporting in pdf (whit export or print either). All the words in the cell after the subscript part disappear in the pdf version. The rest of the table or the document i

  • Error while running AppsLocalLogin.jsp in R11.5.10 on Jdeveloper

    Hi, I am getting error while running AppsLocalLogin.jsp on Jdeveloper for r11.5.10 rup 7. I perform following steps to successfully compile (with warnings only) the page. 1. Copy AppsLocalLogin.jsp from OA_HTML to C:\jdev_r11\jdevhome\jdev\myhtml\OA_

  • Doubts developing web services on JDev 10.1.3.0.4

    Hi, I was trying to follow this guide http://www.oracle.com/technology/oramag/webcolumns/2003/techarticles/balusamy.html in order to develop this web service on Jdev 10.1.3.0.4. But the menus are different from the version used on the tutorial. I´m h

  • Message on mac pro

    Hi, I want to sep up Message on my mac pro, version (Mac OS X version 10.7.5), in sync with imessage on the iphone. However, I can't find the Message program on the Mac pro. I'm wonderring if I should download one from somewhere (I can't find the lin

  • Add menu item in .exe-File

    Is there any way, that i can add a menu item in the .exe-File? I need a menu which is expandable for the customer! thanks wiesi