Defining event handlers for renaming, moving, copying and deleting of files.

Hi every one.
I had created a tool for InDesign CS6 written using Javascript to manipulate portions of text in nested way by marking them with small non-printing small anchored text frames contains sequenced numbers and storing these portions as snippets in a spicific folder beside the InDesign documents.
This tool is open source and free of charge, the only this that I want from you (after downloading) as a user to feedback and as a developer to improve it and join me.
sourceforge.net/projects/livesnippets
My question is not about this but I want to trace when the user rename, move, copy or delete a file of these snippets or any container folder and interact according to that by reserving the links between snippet files and their instances which interspersed in InDesign documents.
Thanks.

Here is an example of using Bridge events… What this scrript will do if you add it to Bridge scripts… is set *all* indesign snippets in the folders you browse to… to be locked/readonly… This means that users will get an extra dialog if they want to delete the file… Finder or Bridge… You can't just rename the file Finder or Bridge… and Bridge's Batch Rename will only function if the user makes copies to new location… You could set this property using the File Object with indesign…
#target bridge
onDocLoaded = function( event ) {
    if ( event.object instanceof Document && event.type == 'loaded' ) {
        lockIDSnippets();
        return { handled: true };
function lockIDSnippets() {
    var i, count, doc, thum;
    doc = app.document;
    count = doc.visibleThumbnailsLength;
    for ( var i = 0; i < count; i++ ) {
        thum = doc.visibleThumbnails[i];
        if ( /\.idms/.test( thum.spec.name ) ) {
            thum.spec.readonly = true;
// Register event handler
app.eventHandlers.push( { handler: onDocLoaded } );

Similar Messages

  • Using a server side package to copy and delete flat files.

    Can anyone tell me if it is possible to copy or delete flat files using comands issued from within a PL/SQL program unit on the server. I know of the package UTL_FILE for the reading and writing of flat files.

    Malcolm,
    if you use 8i, you can create a Java class to do that for you, and call one of it's metohds from PL/SQL, see http://www.oracle.com/oramag/oracle/00-Mar/o20java.html
    null

  • I looked on my C:\ for plugin-container.exe and deleted the file as it kept slowing down my computor, however now when I load firefox it crashes, how can I re-install this plugin to disable it properly?

    My computor had been overly slow which was not normal when looking at processes running in task manager I found plugin-container.exe to be using alot of memory. I looked online and found that this was an update of firefox which was not essential, I then looked on my C:\ drive for the application and deleted it hoping this would solve the problem as I could not find it when looking at my firefox plugins. However now when I open firefox it quickly crashes, how can I reinstall this? Do I need to reinstall firefox completely or is there a more simple solution? I have done the firefox plugin check and it can find no problems.

    Probably the easiest way is to download Firefox again from http://www.mozilla.com and re-install it.
    If you want to disable plugin-container, see the section on "Disabling crash protection" at http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins

  • Moving, copying, and deleting selected pixels

    This question was posted in response to the following article: http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-76dba.h tml

    How can I completely remove selected pixels, so that there is NOT the background colour after pressing delete? I want the picture to become smaller by cutting away unneeded pixels... I already worked a bit with a regular Photoshop version a few years ago and I think there was a cutting tool which cut away the pixels without replacing them... but with Photoshop 5.0 it seems I can only select pixels and press "clear", but then the pixels are not gone, but replaced, which I do not want... how can I make them dissappear when working on a background layer? Yes, this is very basic, but sorry, I cannot find it out...

  • Can´t open, rename, copy or delete PDF file

    I have got a problem opening, renaming, moving, copying and even deleting a PDF file with a very long file name. It does not upload either, so I cannot send it to Adobe via the Support form.
    I have now downloaded a PDF repair application, but I get the following error: "The above file name is invalid". It seems the file is corrupted or damaged. I only managed to open it once, after which it stopped working.
    My OS is XP. I use Adobe Reader to open PDF files.
    Can someone tell me how to deal with this file? Thanks.

    You do not need Reader to change the name of a file. If you cannot change the name of a file in Windows XP, then you have major problems that have nothing to do with Reader. You have at a minimum file directory damage, you could have a virus. Reboot your computer, with no applications open try to change the name of the file using Windows' Explorer app.

  • How to remove event handlers for a content type currently in use?

    Hi,
    We had a SP 2007 solution that managed event handlers as described in
    Brian Wilson's blog regarding event handlers. We then did a in-place upgrade to SP 2010. It so happend that we wanted to remove some of our old event handlers and this is where our problem started. We managed to delete event handlers
    (SPEventReceiverDefinitions) for
    Site and List by using the ui from Brian Wilsons feature "Manage Event Handlers" (ref the link above), but not anyone at all for
    Content Types... It simply wouldn't be deleted
    (remove was grayed out in the ui). 
    We then tried to do it by code. Below is a code snippet illustrating how we tried to delete the event handlers for content types:
    using (SPWeb web = properties.Feature.Parent as SPWeb)
    string targetClassName = "targetClassName.";
    web.AllowUnsafeUpdates = true;
    // Removing Content Type event handlers
    foreach (SPContentType ct in web.ContentTypes)
    for (int i = ct.EventReceivers.Count - 1; i >= 0; i--)
    if (ct.EventReceivers[i].Class.StartsWith(targetClassName))
    ct.EventReceivers[i].Delete();
    ct.Update(true);
    web.Update();
    The Content Types are not sealed and are
    not readonly. When debugging, we can see that the
    Delete() method are called on one of the Content Types we wanted to delete event handlers for. We noted that the
    ct.EventReceivers.Count remains the same, before and after Delete() is called. We did not get any exceptions when running this code.
    When running the code a second time and debugging again, we see that the very same Content Type still has the very same event handler attached... As in, it wasn't deleted....
    We also tried to delete the event handlers through PowerShell as described
    here in the post by Per Jakobsen. However, the script did not really seem to find any EventReceivers... We tried to write the
    $site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} | % {$_.EventReceivers} list to file, but it was empty.. We did however get a long list when writing $site.AllWebs | % {$_.Lists} | % {$_.ContentTypes} to file. We could then in
    that file see the event handler references we want to remove registered to our Content Types, as we did during code debugging earlier on. So PowerShell might still be the way to go here...
    So, does anyone know if there is a way to force this delete through, either by code, PowerShell or some other means? Any help regarding this matter would be very much appreciated :)

    Hi,
    For your information, there's two versions (at least) exists for each content types. One is Site Content Type - exists in Root web and another is list content type. Once you add a content type to a list, a copy of the site content type is taken and stored
    in the list. If you update the site content type, it may or may not affect the list conten type. So make sure you are updating the both - site content and list content type. Once you update site content type with passing paramater true to 'ct.Update(true)',
    the list content types are supposed to updated too.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Event handlers for backbutton

    Hi,
    I want perform some validations when I press back button.how to find event handlers for back button,because F2
    is not giving full info for back button.
    Regards,
    Brahmaji

    Hi,
    the back button is always part of toolbar buttons.
    So you can open the view controller class and open the GET_TOOLBAR_BUTTONS method from that class.
    In this method you see how the BACK button is defined. One of the attribute of button structure is ON_CLICK.
    The value of this attribute should be the event name that is triggered when the button is clicked.
    Now open the DO_HANDLE_EVENT method from the view controller class, you will have methods with prefix EH_ON
    after the prefix you see the event name. If you find one that mached to the event name of the BACK button, then this is the event handler that is triggered by the BACK button.
    Regards,
    Steve

  • ITunes Fix for Manually Moving Music and other Media

    Intro
    Any iTunes 7.x user who manages their own music library outside of the "iTunes Music" folder might be able to tell you that iTunes DOES NOT respond well after manually moving tracks from one place to another on their computer systems. In fact, any file you move becomes immediately unplayable in iTunes. And, if you're anything like I am, losing several years worth of song rating metadata and playlists is not a good incentive for change. However, one thing others might not be able to tell you is that there's an easy workaround for the problem and you get to keep your playlists, ratings and other info. Read on to learn about the workaround.
    About the Workaround
    The workaround is a simple hack I devised after recently transferring a good portion of my music library between hard disks and running into problems with iTunes. The fix steps provided below are intended to circumvent the problems with iTunes and give users the freedom to move songs and other media files on their computers while maintaining the integrity of both the ratings and the playlists. Meaning you won't need to manually update the song locations in iTunes one-at-a-time, which, at version 7.02 is the only way to accomplish this task using the program.
    Please be aware that not all information is retained using this workaround. What will be lost are the following: the "Recently Added", "Recently Played" and "Top 25 Most Played" iTunes Smart Playlists; any media file play counts; last played information; and possibly some other data used only internally by iTunes.
    So, if you're comfortable parting with some metadata while keeping your cherished song ratings and playlists intact during file relocation, read on to learn how to use the workaround.
    Workaround Steps
    The following instructions walk step-by-step through the process of this workaround.
    Note: All backslashes used in file paths have been converted to forward slashes so that they will adhere with MySpace XSS security validation checks. These altered paths can still be copy/paste into Windows Vista's Explorer program once the Username is changed to the User Account where the iTunes files reside.
    Preparing for the Move
    Before you move your files, do the following:
    1. Close iTunes.
    2. Create a backup copy of the following files:
    iTunes Library XML (iTunes Music Library.xml)
    Note: Vista users can find the Library XML at C:/Users/Username/Music/iTunes
    iTunes Music Database (iTunes Library.itl)
    Note: Vista users can find the Music Database at C:/Users/Username/Music/iTunes
    Moving Your Files
    This part should be self explanatory, but while you do it make sure to note the following two things:
    1. The path where the files were previously stored (e.g. D:/Music).
    2. The path where the files will end up (e.g. E:/Music).
    Execute the Fix
    After your files are moved, complete the following steps to implement the fix.
    Note: Do not open iTunes during this process.
    Hack the iTunes Library XML
    Once the files are moved the Library XML file locations will be out of sync. Follow the steps below to update them so that they now reference the correct file locations.
    1. Open the iTunes Library XML with a Text Editor with a Find/Replace function.
    Note: Vista users can find the Library XML at C:/Users/Username/Music/iTunes
    Tip: Do not try to do this with Dreamweaver if your Library XML is greater than 10MB.
    2. Perform a Find/Replace using the following inputs:
    Find: Path from Step 1 of Moving Your Files
    Replace: Path from Step 2 of Moving Your Files
    3. Confirm your results, and then save and close the Library XML.
    Delete the iTunes Music Database
    Hacking the iTunes Library isn't enough to fool iTunes. Like the Library XML, the Music Database also holds the file locations of all of the media stored within the program. And it's smart enough to wipe out the Library XML hack if iTunes is opened before completing this step.
    Ensure you have backed up the iTunes Music Database (iTunes Library.itl) and delete the file.
    Note: Vista users can find the Music Database at C:/Users/Username/Music/iTunes
    Back in iTunes
    Once the fix is in place you can now open iTunes again. You will notice that all of your playlists, music and other items have vanished. In order to recover them all (with the exception of the Smart Playlists mentioned in the About the Workaround section above) we'll need to import the hacked Library XML file back into iTunes.
    1. Open iTunes and press CtrlShiftO or go to File > Import…
    2. Navigate to and Open your modified Library XML (as pictured below).
    3. iTunes will then begin importing the contents of the XML file (as pictured below).
    Note: This process may take a while, depending on the size if your library.
    Wrapping Up
    Once the import process is complete iTunes will look almost exactly the way you left it, with the exception that some playlists have been duplicated and the number of songs may be a hair off. To fix this problem delete any duplicate playlists in the "Library" panel in iTunes. You can now test out the changes by selecting an item moved earlier and testing it out. All that's left from there is to let iTunes perform any automated analysis it needs to do and rock on.
      Other OS  

    Holy Smokes:
    I appreciate your detailed workaround post. My question is this: I use iTunes to keep everything organized (though I'm well aware of the shortcomings...) and can use the simple solution that Chris from CA posted, but I don't have room to consolidate everything. My read on consolidating is that you copy from wherever you have your music located (and right now my music is outside of the MyMusic/iTunes folder, as that backs up to my work server) and so you have to have enough room for all of your music to be copied (and then you delete it from its prior location). That's how Apple describes it in, e.g., http://docs.info.apple.com/article.html?artnum=301748. I ain't go that kind of room. Is there any way to make the move to a completely different PC by following the simple option? From the posting I just linked it sounds like you MUST consolidate whether you use you iPod to move things or use an external drive.
    Of course, I can use your workaround, but I thought I'd ask first. Many thanks.
      Windows XP Pro   iPod Video 60gb

  • HT1386 hi, when i am syn my books from my mac to ipad even after one full day sync itunes show wait for items to copy and the books in ipad are still not fully loaded. how do i fix this, i have a large collection of books

    hi, when i am sync my books from my mac to ipad even after 24 hours sync, itunes show "wait for items to copy" and the books in ipad are still not fully loaded.
    how do i fix this, i have a large collection of books around 12000 books

    Nobody knows? Not even administrators?
    Please it would be really nice to have help on that to take all the benefit of the remote app.
    Thank you very much in advance.

  • Getting eroor while copying and deleting user

    Hi All,
      I am unable to copy and delete users from one client, we are in ecc6.0. i am getting the following error while copying and deleting. the error is
    NUMBER_GET_NEXT AENDBELEG INTERVAL_MISSING.
    Please help me in this regard,
    thanks,
    praveen

    Hi Praveen,
    Implement the program correction to ensure that the system issues the correct error message.
    Manually create the missing interval.
    You can use error message CD 121 to enable you to identify the error more accurately. Depending on the additional information, the status is as follows:
    OBJECT_MISSING : The entire AENDBELEG number range object is missing and must be created.
    INTERVAL_MISSING: Number range interval 01 is missing and must be created.
    INTERVAL_NOT_INTERNAL: The definition of number range interval 01 is incorrectly set to 'external number assignment'. Delete the 'external' selection in the interval definition.
    Check the definition of the AENDBELEG number range object in transaction SNRO:
    Object name:   AENDBELEG
    Short text:    Change documents
    Long text:     Number Ranges for Change Documents
    To-year flag:                        Do not select
    Number length domain:                 CHAR10
    No interval rolling:                  Do not select
    Number range transaction:             SCDN
    Warning %:                            10.0
    Main memory buffering:
    No. of numbers in buffer:             10
    You must define the following interval:
    Interval No. 01
    from 0000000001
    to 9999999999
    internal number assignment
    Please look st SAP Note: <b>659573</b>
    Hope it helps.
    Please award points if it is useful.
    Thanks & Regards,
    Santosh

  • Advanced table copy and delete slow when done programatically

    I am modifying a line in an advanced table, then copying it and deleting it. What I noticed is that
    it takes a lot less time to copy and delete manually within the application verses doing it programatically.
    To copy or delete 10 lines it takes about 1 or 2 seconds within the form. When I do this programatically
    it can take up to 20 seconds. Does anyone know why it takes so much longer?
    Here is a sample of my code.
              porequisitionlinesvorowimpl.setSelected("Y"); //programatically select line for copy
         ArrayList deletearraylist = null;
         String s1 = porequisitionlinesvorowimpl.getItemNumber();
              java.sql.Connection connection = oadbtransaction.getJdbcConnection();
              //Query values from for child item.
              OraclePreparedStatement oraclepreparedstatement = null;
              ResultSet resultset = null;
              try {oraclepreparedstatement = (OraclePreparedStatement)connection.prepareStatement("SELECT I2.DESCRIPTION WHERE                       I.SEGMENT1 = ?");
                               int i = 1;
                               oraclepreparedstatement.defineColumnType(i++, 12, 240);                                                                 oraclepreparedstatement.setString(1, s1);
                               resultset = oraclepreparedstatement.executeQuery();
                               while(resultset.next())
                                    //Collect values from query for child item.
                                    String desc = resultset.getString(1);
                              porequisitionlinesvorowimpl.setItemDescription(desc);
                              //Copy modified parent to produce a child line.
                              ArrayList copyarraylist = new ArrayList(2);
                               copyarraylist.add("populateAndDuplicate");
                               copyarraylist.add("lines");
                               executeServerCommand(oapagecontext, oaapplicationmodule, "CheckoutLinesSvrCmd", copyarraylist);
                               } //while loop for resultset
              resultset.close();
         oraclepreparedstatement.close();
              catch(SQLException sqlexception) {
                   ErrorUtil.handleFatalException(oadbtransaction, sqlexception, this);
              //Delete original Kit Parent           
              deletearraylist = new ArrayList(2);
              deletearraylist.add("populateAndDeleteReqLines");
              deletearraylist.add("lines");
              executeServerCommand(oapagecontext, oaapplicationmodule, "CheckoutLinesSvrCmd", deletearraylist);

    I timed these too and they appeared to completed very quickly. The only events that took a significant amount of time where the calls to the executeServerCommand when I copied and deleted lines.
    Can the database connection and looping the resultset be slowing these activities down?
    There is no VO existing that generates the query results I am looking for. Do I need to create my own VO?

  • I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items to those devices but it won't work. I also have tried copying and pasting those files onto those devices but that doesn't work too. Can any one help?

    I'm not able to copy and paste files from my mac to hard disk and usb. I have tried dragging the items I want to copy to those devices but it won't work. I also have tried copying and pasting those files onto those devices too but that doesn't work too. Can any one help?

    Hi BobRz
    Thanks for you suggestion but it didn't work - are there other ways for solving this problem? Or is it because my files that I want to copy and paste onto my hard disk etc are too big? (However there is space on my hard disk and it works on a PC)

  • I installed Windows 7 in my Macbook pro, I can access Windows data in Mac, but I can't copy and delete it. and the same case while i am working in Windows. Could you please guide me if there is any solution, where I could copy/paste/delete my data.

    I installed Windows 7 in my Macbook pro, I can access Windows data in Mac, but I can't copy and delete it. and the same case while i am working in Windows. Could you please guide me if there is any solution, where I could copy/paste/delete my data.

    OS X can natively read NTFS of Windows, but not write to it.
    Windows can't read or write to HFS+ of OSX, and that's a good thing from a security standpoint.
    Ideally if you share files between operating systems you should have a FAT/MSDOS formated USB key or hard drive. (exFAT external drive if any of your files are over 4GB in size) both these formats are universal for OS X or Windows.
    If you install software into Windows and OS X to read each others formats, then you have to pay to update/upgrade it deal with headaches.
    If you swtich between Windows and OS X a lot, don't need full hardware performance for Windows, you may consider installing virtual machine software like VMFusion or Parallels which can take a copy of your Windows in Bootcamp and place it into OS X as a file then run that copy of Windows in a window in OS X like so.
    Advantage here is you run most of your light weight Windows programs like this at the same time as OS X.
    Benefit is you can run just about any Windows or Linux version and OSX server editions (not client versions)
    Bootcamp only allows Windows 7, that's it now.
    You'll also be interested in two fre pieces of software, Carbon Copy Cloner and Winclone on macupdate.com.
    CCC clones OS X partition and Winclone clones the Bootcamp partition. Valuable for you.
    Good Luck

  • Copy and paste a file path?

    How do i copy and paste a file path?
    Thanks

    I assume there's probably a utility in macupdate.com that could probably do that.  A quick search on macupdate for "copy path" found a bunch.
    Alternatively you could create an automater service (finder contextual menu) to do it.
    Or just drag the finder item into the terminal window.  The path will appear and you can copy/paste that.

  • Copy and Paste multi files

    I know how to copy and paste a file but I want to select all files and copy it to a folder I don't want to select one at time help

    Your best friend to do all this is to use file manager.. Open up file manager app, Just go into the device or SD card, select the folder or files, then it will give you the option to copy, move , zip share , rename etc..

Maybe you are looking for

  • Jpg,gif, and gui's

    hey guys, I just started learning to code gui's... but my book is vague about inserting jpg or gif..... I was using: ImageIcon b = new ImageIcon("board.jpg"); I keep getting a blank canvas.. Can someone help me with siimple code for making a gui with

  • HT204406 How do I access greyed out songs on the ipod touch after subscribing to iTunes Match?

    I have just subscribed to iTunes March and now I cannot access my songs on the iPod Touch. The songs can be seen but are greyed out. ANyone know what I need to do?

  • Maps : report inaccurate information

    I would like to know how to report inaccuracies in Maps. There should be a direct way to give feedback so we can help keep the Maps database accurate. I'm using Maps on the Z10. -SDM

  • Re DVD Studio Pro 4:  help with color saturation

    Re DVD Studio Pro 4:  having trouble with the color saturation on the text of menu buttons.  been using the same method for years, checked opacity of colors.  All of a sudden, the text color is splotchy and looks unprofessional. Clients are complaini

  • Facebook wont load pages in firefox

    Its loading apps but not messages or friends profiles and it wont open facebook itself I have to go through emails from facebook to get there. firefox error console is coming up with: Error: Permission denied for (document.domain=) to call method Unn