Hide one layer, and remove the visible layers using preflights!

Hello,
I have one pdf (with one layer called "ARTWORK")  in which I create a layer using Javascript. To do this I create a watermark and asigning it to a OCG contents with this code:
this.addWatermarkFromText("watermark");
this.getOCGs();
function FindOCG(cName) {
    var aOCGs = this.getOCGs();
    for(var i=0; aOCGs && i<aOCGs.length;i++) {
        if(aOCGs[i].name == cName) return aOCGs[i];
    return null;
var ocg = null;
while( (ocg = FindOCG("Watermark")) != null) ocg.name = "NEW LAYER";
this.setOCGOrder(this.getOCGs());
Then I successfully run a preflight profile, which is able to select an object filled with a defined spot colour and put it on the layer named "NEW LAYER"
The result of this is that I have two layers, (ARTWORK and NEW LAYER)
But when I want to view ONLY the contents of the NEW LAYER, it is necessary to  show the ARTWORK layer as well, otherwise I see the only the text "watermark" added in the Javascript.
My intention is hide the ARTWORK layer and show only the elements that I moved to the NEW LAYER, running the following Javascript code:
var ocgs = this.getOCGs();
for (var i in ocgs) {
    if (ocgs[i].name=="NEW LAYER")
        ocgs[i].state = true;
else ocgs[i].state = false;
and then run another preflight to remove invisible layers.
But it seems  that even that I move the elements to the new layer, somehow they still remain in the artwork layer...
Anyone could help me to solve this, please?
Thanks and Regards.

This is not really a JS question, more of a Preflight question...

Similar Messages

  • [svn] 3120: When you point Flex Builder at a local sandbox trunk build, it couldn' t generate the html-templates folder correctly for new projects so we moved all the html templates up one level and removed the html-templates directory and adjusted build

    Revision: 3120
    Author: [email protected]
    Date: 2008-09-05 10:44:10 -0700 (Fri, 05 Sep 2008)
    Log Message:
    When you point Flex Builder at a local sandbox trunk build, it couldn't generate the html-templates folder correctly for new projects so we moved all the html templates up one level and removed the html-templates directory and adjusted build.xml's to accommodate the directory change
    Modified Paths:
    flex/sdk/trunk/build.xml
    flex/sdk/trunk/webapps/webtier/build.xml
    Added Paths:
    flex/sdk/trunk/templates/client-side-detection/
    flex/sdk/trunk/templates/client-side-detection/AC_OETags.js
    flex/sdk/trunk/templates/client-side-detection/index.template.html
    flex/sdk/trunk/templates/client-side-detection-with-history/
    flex/sdk/trunk/templates/client-side-detection-with-history/AC_OETags.js
    flex/sdk/trunk/templates/client-side-detection-with-history/history/
    flex/sdk/trunk/templates/client-side-detection-with-history/history/history.css
    flex/sdk/trunk/templates/client-side-detection-with-history/history/history.js
    flex/sdk/trunk/templates/client-side-detection-with-history/history/historyFrame.html
    flex/sdk/trunk/templates/client-side-detection-with-history/index.template.html
    flex/sdk/trunk/templates/express-installation/
    flex/sdk/trunk/templates/express-installation/AC_OETags.js
    flex/sdk/trunk/templates/express-installation/index.template.html
    flex/sdk/trunk/templates/express-installation/playerProductInstall.swf
    flex/sdk/trunk/templates/express-installation-with-history/
    flex/sdk/trunk/templates/express-installation-with-history/AC_OETags.js
    flex/sdk/trunk/templates/express-installation-with-history/history/
    flex/sdk/trunk/templates/express-installation-with-history/history/history.css
    flex/sdk/trunk/templates/express-installation-with-history/history/history.js
    flex/sdk/trunk/templates/express-installation-with-history/history/historyFrame.html
    flex/sdk/trunk/templates/express-installation-with-history/index.template.html
    flex/sdk/trunk/templates/express-installation-with-history/playerProductInstall.swf
    flex/sdk/trunk/templates/metadata/
    flex/sdk/trunk/templates/metadata/AC_OETags.js
    flex/sdk/trunk/templates/metadata/readme.txt
    flex/sdk/trunk/templates/no-player-detection/
    flex/sdk/trunk/templates/no-player-detection/AC_OETags.js
    flex/sdk/trunk/templates/no-player-detection/index.template.html
    flex/sdk/trunk/templates/no-player-detection-with-history/
    flex/sdk/trunk/templates/no-player-detection-with-history/AC_OETags.js
    flex/sdk/trunk/templates/no-player-detection-with-history/history/
    flex/sdk/trunk/templates/no-player-detection-with-history/history/history.css
    flex/sdk/trunk/templates/no-player-detection-with-history/history/history.js
    flex/sdk/trunk/templates/no-player-detection-with-history/history/historyFrame.html
    flex/sdk/trunk/templates/no-player-detection-with-history/index.template.html
    Removed Paths:
    flex/sdk/trunk/templates/html-templates/

    Remember that Arch Arm is a different distribution, but we try to bend the rules and provide limited support for them.  This may or may not be unique to Arch Arm, so you might try asking on their forums as well.

  • I have two computers that I uploaded my Photoshop to. One I just removed the program and the second

    I have two computers that I uploaded my Photoshop to. One I just removed the program and the second I erased the hard drive and sent back to the company. I have a brand new computer and am unable to install Photoshop due to the two computer limit. How can I gain access again.

    in the future and if possible, deactivate (help>deactivate).
    for now, contact adobe support for an activation reset, http://helpx.adobe.com/contact.html?product=flash&topic=using-my-product-or-service

  • [svn:fx-trunk] 13304: When updating to TLF 584 forgot to add the new rsl and remove the old one.

    Revision: 13304
    Revision: 13304
    Author:   [email protected]
    Date:     2010-01-06 07:59:22 -0800 (Wed, 06 Jan 2010)
    Log Message:
    When updating to TLF 584 forgot to add the new rsl and remove the old one.
    QE notes:
    Doc notes:
    Bugs:
    Reviewer:
    Tests run:
    Is noteworthy for integration:
    Added Paths:
        flex/sdk/trunk/frameworks/rsls/textLayout_1.0.0.584.swf
    Removed Paths:
        flex/sdk/trunk/frameworks/rsls/textLayout_1.0.0.571.swf

    iTunes needs QuickTime to work.
    I think you will be all set if you install QuickTime standalone, not regular
    http://www.apple.com/quicktime/download/standalone.html
    Download the isntall file to your hard drive - don't install it over the internet.
    If you are running anything Norton, turn that completely off before installing.

  • My iPad is disabled and won't connect to iTunes on any computer; I went to my iCloud and removed the iPad so it will erase all data when the iPad is connected to the internet (the original problem was a restrictions passcode we forgot)

    Here is the order of what I did to my iPad:
    1.  A restrictions passcode was put on and we couldn't remember it.  Despite numerous attempts at righting this, I couldn't. The iPad would not sync with any iTunes on any computer, Mac or PC.
    2.  I put a, 'use passcode after one minute' passcode on it and deliberately put in 10 wrong passcodes so it would disable the iPad.  Now it still will not connect to any iTunes.
    3.  I connected to my iCloud account and removed the iPad from the cloud; it says it will erase all iPad data when it connects to the internet.  I am fine with that, I need to know what to do now, though. iPad says, 'Connect to iTunes,' but it won't.  Please help this amateur of all amateurs!!

    See iPhone DFU mode explained, and how to enter DFU mode.

  • How do I find bad music files?  I have thousands of files, but some are bad.  When I try to load them into iTunes, it just spins.  I need a routine to identify and remove the bad files.  Any ideas?

    How do I find bad music files?  I have thousands of files, but some are bad.  When I try to load them into iTunes, it just spins.  I need a routine to identify and remove the bad files.  Any ideas?

    Hi ajoddo20,
    Welcome to the Apple Support Communities!
    You can use Home Sharing to import music and other media from one computer to another. Please use the instructions and information located in the attached article for information on how to complete the process. 
    iTunes 11 for Mac: Use Home Sharing to import items from another iTunes library
    Cheers,
    Joe 

  • How to resolve unresolved column error when we change column name in BMM Layer and removed alias in presentation layer

    how to resolve unresolved column error when we change column name in BMM Layer and removed alias in presentation layer

    Looks like the presentation column got Alias before your BMM changes, so in your case renaming logical column and deleting alias is not good to go.
    Keep Alias

  • Move a file to external disk and remove the original

    This is a script that was supplied to me on these forums it has been working well, but all the transferring of the files took place locally so a 'Move' command does it eactly what it says, however I now need to move it to an external drive, as a result it leaves trace of the original file.
    How can I make it MOVE and remove the origial File please?
    set fileMatrix to {¬
              {folderName:"BHS", prefixes:{"BH70", "SM70", "AL70", "BH11"}}, ¬
              {folderName:"Bu", prefixes:{"BU40", "BU11"}}, ¬
              {folderName:"Ca", prefixes:{"CW"}}, ¬
              {folderName:"Da", prefixes:{"ES20", "AM20"}}, ¬
              {folderName:"Di", prefixes:{"DV25", "DV11"}}, ¬
              {folderName:"Do", prefixes:{"DJ30", "RA30", "DJ11"}}, ¬
              {folderName:"In", prefixes:{"GT55", "CC55"}}, ¬
              {folderName:"Fr", prefixes:{"FR10", "FR11", "FR17"}}, ¬
              {folderName:"No", prefixes:{"TM17", "NN_"}}, ¬
              {folderName:"Ma", prefixes:{"MA65", "MF65", "FI65", "MC65", "MH65", "MB65"}}, ¬
              {folderName:"Pr", prefixes:{"PR_"}}, ¬
              {folderName:"To", prefixes:{"TM15", "TM11"}}, ¬
              {folderName:"Wa", prefixes:{"WA35", "WA11"}}, ¬
              {folderName:"Se", prefixes:{"SE_"}}, ¬
              {folderName:"Mik", prefixes:{""}}}
    tell application "Finder"
      --set theHotFolder to ((path to pictures folder) as text) & "HotFolderDone"
              set theHotFolder to folder "StudioA:Users:StudioA:Pictures:HotFolderDone"
      --set foldericon to ((path to pictures folder) as text) & "Icons:Rejected Folder Done"
              set foldericon to folder "StudioA:Users:StudioA:Pictures:Icons:Rejected Folder Done"
      --set fakeTrash to ((path to home folder) as text) & "FakeTrash"
              set fakeTrash to folder "StudioA:Users:StudioA:FakeTrash"
    set a to alias "Scratches:Workings"
              repeat with matrixItem in fileMatrix -- look for folder
    set destinationFolder to (folders of a whose name starts with folderName of matrixItem)
                        if destinationFolder is not {} then -- found one
                                  set destinationFolder to first item of destinationFolder -- only one destination
                                  set theFolderName to name of destinationFolder
                                  repeat with aPrefix in prefixes of matrixItem -- look for files
                                            repeat with startFile in ((files of theHotFolder whose name starts with aPrefix) as alias list) -- move files
                                                      try
      move startFile to destinationFolder
                                                      on error
      activate
                                                                display dialog "File “" & (name of startFile) & "” already exists in folder “" & theFolderName & "”. Do you want to replace it?" buttons {"Don't replace", "Replace"} default button 2 with icon 1
                                                                if (button returned of the result) is "Replace" then
                                                                          set {fileName, t_ext} to {name, name extension} of startFile
                                                                          if exists file fileName of fakeTrash then -- and it also exists in the fakeTrash Folder.
                                                                                    set name of file fileName of destinationFolder to "this is a unique name" -- or whatever
                                                                                    set newName to my getUniqueName(fileName, t_ext, fakeTrash)
                                                                                    set movedFile to move file "this is a unique name" of destinationFolder to fakeTrash
                                                                                    set name of movedFile to newName
                                                                          else -- not exists in the fakeTrash Folder.
      move file fileName of destinationFolder to fakeTrash
                                                                          end if
      move startFile to destinationFolder
                                                                else -- "Don't replace"
                                                                          if not (exists folder "StudioA:Users:StudioA:Desktop:Rejected Folder Done") then
                                                                                    set theLastFolder to duplicate foldericon to desktop
                                                                          else
                                                                                    set theLastFolder to folder "StudioA:Users:StudioA:Desktop:Rejected Folder Done"
                                                                          end if
                                                                          delay 0.5
      move startFile to theLastFolder with replacing
                                                                end if
                                                      end try
                                            end repeat
                                  end repeat
                        end if
              end repeat
              try
                        if (count theLastFolder) is 0 then delete theLastFolder
              end try
    end tell
    to getUniqueName(theName, theExtension, someFolder)
         check if someFile exists in someFolder, creating a new unique file name (if needed) by adding a suffix
              parameters -          theName, theExtension : a file name and his name extension
                                  someFolder : a folder (finder item or alias)
              returns :     a unique name
              set {counter, suffixes, divider} to {0, "abcdefghijklmnopqrstuvwxyz", "_"}
              if theExtension is not "" then set theExtension to "." & theExtension
              set theName to text 1 thru -((length of theExtension) + 1) of theName -- just the name part
              set newName to theName & theExtension
              tell application "Finder" to set theseNames to name of items of someFolder
              repeat while theseNames contains newName
                        set counter to counter + 1 -- hopefully there aren't more than 26 duplicates (numbers are easier)
                        set newName to theName & divider & (item counter of suffixes) & theExtension
              end repeat
              return newName
    end getUniqueName

    I do not have the time to read through your whole script and give specific answers, but the general principle is fairly easy.  You're moving with the Finder, so your move command is going to be of the form:
    tell application "Finder"
      move file xxxx to folder yyyy
    end tell
    For cross file system moves (which are as you point out actually duplications) just add a line after each move that sends the old file to the trash:
    tell application "Finder"
      move file xxxx to folder yyyy
      delete file xxxx
    end tell
    the Finder has an empty trash command that you can use at the end of the script if you like.
    One gotcha: because move has two different behaviors, the second code block will throw an error if you try to use if for a local move (it will move the file properly, then try to delete the file it moved, which is obviously no longer there).  For clarity, I'd use duplicate rather than move for if you're working across file systems.  That's what you're actually doing, and if you use the move command you may confuse yourself when you come back to look at the script a year down the road.

  • How can one find and remove hidden tracking software on an iphone

    How can one find and remove hidden tracking software on an iphone

    When folks did not know that it was there, they assume that it is hidden. Even the EU and the US congress got all up in arms about it.

  • How do you take information from one layer and switch it to another?

    I am trying to figure out how to take pictures and text that I have already placed on one layer and switch it to another layer. I have like 50 pages worth of information and I am trying to look for the easiest way to do this. In illustrator and Photoshop, its pretty easy. Wanting to know if it is the same because I have been trying but it is not there. Just in case it matters, Im using CS5 on a pc. Help is greatly appreciated.

    Hi Martin,
    Please follow the below steps.
    Step 1
    Create the separate layer. Select the content you want to move.
    Step 2
    Go to check layer panel, near the pen symbol icon, the below box drag to move up to the image layer, see sample
    Step 3
    This option use spread wise content, it will complete the task with fast. If more faster, please raise as question to Scripting Forum, they can suggest the tool.

  • Apple, why did you change my Keyboard and remove the enter key?

    Hi all,
    I had my new black MacBook delivered just before Christmas. The keyboard has changed from my previous Black MacBook (the one a colleague poured wine over and killed... grrr).
    Apple have changed the look of the command key and removed the Apple logo (very sad), but more frustratingly have replaced the 'enter' key with another 'option' key.
    I found the 'enter' key really useful, especially for pull down menu and really miss having one.
    Does anyone know if there is a way to assign the new 'option' key to be an 'enter' key?
    Cheers
    Scott.

    I just received a new(refub) MacBook 2.2GHz today and was very disappointed to find the enter key missing. After selling my G4 PowerBook six months ago, I was so looking forward to having the convenience of being able to slap the enter key for dialog boxes with and submitting forms without having to move my hand from the trackpad. I hope that someone will come up with a way to replace the functionality of the missing enter key.
    Which brings me to my next point- There has been a big oversight in the implementation of the MacBook's replacement of the Enter Key, which is to use the FN+Return keys. It seems that when using the FN key with the Return key, the system will ignore the Command key being invoked. I discovered this very quickly. Anyone who uses Apple Remote Desktop knows that in order to send a Unix command to a remote machine, you type the command in the 'send UNIX command' window, then hit Command+Enter to send the command. Return produces a carriage return, FN+Return does nothing, and FNCommandReturn does nothing. The only current work around is to use the track pad to the "Send" button and click, which really slows things down.

  • X120e 0596 screen wont wake up after sleep mode until unplug it and remove the battery

    I recently purchased a Thinkpad X120e (0596) and am genneraly very happy with it however when it goes to sleep the screen does not wake up when the laptop does. when i wake it up i hear the fan spin up but the the screen remans powered off. ive tried waiting several minutes and it still doesnt wake up, ive also tried holding the power button for several (more than 5 ) seconds to force it to power off fully then start it again and the screen still doesnt wake up. the only way i can get it to work again is to make sure to unplug it and remove the battery for several seconds then i can get it to boot with the normaly expected complaints from windows after an abnormal shutdown.
    I have the latest updates from lenovo and microsoft installed including the latest firmware. I like the laptop so i would rather report the problem and provide any information neccisary to find a resolution than have to return it. Ive seen this problem with other laptops before and know its probably a  bug in the firmware thats not waking up the GPU is ther any tool i can use to provide the debuging info or any more direct way for me to report the bug I tried calling customer support and they told me they told me my only option was to return it and they could not report or record the issue.

    Same issue here, confirmed many times in linux, will likely recur at some point now that I am on windows (8).  The event log from the HAL says "The platform firmware has corrupted memory across the previous system power transition. Please check for updated firmware for your system" even after successful suspends, so who knows what happens when it fails. Since it's video-related, the problem could as well be in AMD's driver (also hinting at this is the fact the system periodically freezes when the screen is simply turned off from being idle).
    Also worth noting is the fact suspend seemed to work just fine on my system with the factory BIOS (1.08), with the issue appearing only in newer ones (the oldest one still available for download is already affected, and I am running the latest one). There are also slight differences in the issue between the legacy and UEFI boot modes, but none of them mitigate it.

  • I have 2 iphones syncing on one computer and on the same apple ID. Before i updatad my Itunes to the last available update and my Iphones to 5.01 i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens when c

    I have 2 iphones syncing on one computer and on the same apple ID.
    Before i updatad my Itunes to the last available update and my Iphones to 5.01
    i had no problem draging jpg. and mp3 files into my iphones DCIM folder (the picture folder that opens
    when conecting to Itunes). Since my updates Itune wont let me drag and drop any files' even pictures that
    were taken with my Iphone on 4.3.3.
    Please help as we have no itunes music in Israel, only apps and i cant copy any of my old music from my computer
    to my iphones.
    If it helps, i am using a pc with 32 bit windows 7.
    Other from the obove Itunes works fine and does sync pictures from my computer to my Iphone from "my pictures" folder.
    Thank you for your time
    Yoni Bliss
    [email protected]

    The title of my initial post is a bit misleading. I already took a chance deleting one of the iPhones, hoping if I deleted the wrong one, I can still reauthorize it (all with the same Apple ID acct, so not subject to 90-day waiting period, right?) The iTunes database just updated itself, and it says I have 4 "devices" "in the Cloud", but 5 "computers" associated w my account. How can I find out what computers are associated? Isn't there a list I can see? I dont have a clue what computers they might be. If I use the  "Deauthorize All" option, is it a pain to add them all back in. I assume I would have to log in from each computer to reauthorize each one. Would I have to be running the newest OS or version of iTunes to reauthorize? I think I have a PowerBook G4 Titanium with an older OS and iTunes. I'd like to keep that authorized, if possible.

  • When I import a commercial CD itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the other album by it self. How can I combine them all into one album and why is itunes doing this?

    When I import a commerical CD Itunes will create 2 identical albums and put all of the songs except one into one album and put the other song into the second album that it created.  Why is itunes doing this and what can I do to combine them into one album?

    I found this to be somewhat helpful: Grouping Tracks into Albums
    What I did was to put in the same name for Album Artist in every track.  That seemed to do the trick (previously all those fields were empty).  It seems like a lot of work for a simple thing.
    iTunes knows (or should know) that these tracks were imported from one CD. So why is it relying on incomplete data from the gracenote database?

  • Why does my apple id in app store settings show one thing and in the apps it shows a different id (ccl43) no email address)

    why does my apple id in app store settings show one thing and in the apps it shows a different id (ccl43) no email address) 
    I am unsure what to do I cannot get into my apps account in order to upgrade it.  HELP PLEASE!!!!!!

    It's the Apple ID that app was purchased with.

Maybe you are looking for

  • Invalid entry CRC  - Bad WebLogic 5.1 Download? -

    Does this indicate a corrupted download? The .zip file does not fully unzip without error. [weblogic@machine weblogic]$ jar -xf weblogic510.zip java.util.zip.ZipException: invalid entry CRC (expected 0x3b1b22da but got 0xf1863a15) at java.util.zip.Zi

  • Missing ProPhoto RGB and Mini Bridge in CS5 version 12.0.4??

    I am missing the ProPhoto RGB in the Color Settings in Photoshop CS5. Also the Mini  Bridge in Photoshop CS5 just shows Waiting for Bridge, but never retrieves anything. I did a video to show the problems in detail at: Thank you for any help you can

  • Parallel sequence-Process Industry

    Hi All, Following is the scenario req in SAP Stage-1: Crude prep- (Done in 10 reactors, R1, R2,R3......R10)-Parallel sequence Stage-2  Pure prep- Done in single Reactor (P1) Stage-3  Storage-(4 silos) Stage-4 Packing How to address this in Master rec

  • Will Plantronics Voyager 510 bluetooth headset work with the latest macbook

    i just received my latest new macbook last week and am considering buying the Plantronics Voyager 510 bluetooth headset for all voice communication over yahoo, ichat or skype (current version of skype has problems with leopard firewall, i hear skype

  • IPhoto running slow - how to improve?

    I currently am running iphoto with MacBook Pro - all are currently updated and running on the most recent versions. I have over 13,000 photos loaded and continue to upload weekly. My question is - my iPhoto program is very slow and I'm wondering if I