Need Help Creating A Script For Labeling Finder Files from Indesign

Trying to figure out a way to have a script run in InDesign CS4 that will label a text file RED after it's been imported into InDesign.
We import numerous text files into an InDesign template. Since there are several text files in the same folder, we need to somehow "mark off" that we've imported that file and move to the next one to import. I have created an Automator "service" with a keyboard shortcut to label the file Red in the finder but it would be great if we could have this happen automatically after we import into InDesign.
If we import the wrong text file by accident and it gets missed in proofing, it costs us a lot of money with the printer.
Thanks for any ideas.
Jim

You know, these guys are absolutely right in their assessment that this is a good place for event listeners. You would need three scripts though.
Something like...
Label Placed Files Red.scpt
--Put this in a folder called IDScripts in your Documents folder
main(evt)
on main(myEvent)
tell application "Adobe InDesign CS4"
set placedFilePath to full name of myEvent
set placedFilePath to placedFilePath as alias
end tell
tell application "Finder"
--This turns the file color red
set label index of placedFilePath to 2
end tell
end main
And these two are in your InDesign scripts folder...
Start Placed File Finder Labelling.scpt
--Installs the afterImport event listener for the Label Placed Files Red script.
tell application "Adobe InDesign CS4"
set myHandler to path to documents folder
set myScriptName to "Label Placed Files Red.scpt"
set myHandler to "" & myHandler & "IDScripts:" & myScriptName
try
set myHandler to myHandler as alias
make event listener with properties {event type:"afterImport", handler:myHandler, captures:true}
display dialog "Placed File Labelling: ON" buttons "OK" default button 1
on error
display dialog "ERROR: Couldn't start handler!" & return & return & "Make sure the \"" & myScriptName & "\" script in a folder called \"IDScripts\" inside your Documents folder and try again" buttons "OK" default button 1
end try
end tell
Stop Placed File Finder Labelling.scpt
--Removes the afterImport event listener for the Label Placed Files Red script.
tell application "Adobe InDesign CS4"
set myHandler to path to documents folder
set myScriptName to "Label Placed Files Red.scpt"
set myHandler to "" & myHandler & "IDScripts:" & myScriptName
set myHandler to myHandler as alias
set myResult to remove event listener event type "afterImport" handler myHandler with captures
if (myResult is false) then
display dialog "ERROR: Couldn't remove handler! Are you sure it is active?" & return & return & "If so, please quit and relaunch InDesign to get rid of it." buttons "OK" default button 1
else
display dialog "Placed File Labelling: OFF" buttons "OK" default button 1
end if
end tell

Similar Messages

  • Need help with easy script for open / close app and move files

    Hi,
    I'm not a scripter.. never done anything special perhaps more complicated than /shutdown -s on cmd..
    I actually learned ASCII C language on university but never used it in real.
    I'm trying to create a basic script that perhaps you could help me or guide me how to do it..
    The commands are
    1) Close a running app (end task it or force kill it, I prefer end task it)
    2) delete files from x location
    3) run .exe app from y location
    4) close that running app 
    5) move files from z to y
    Perhaps adding few "wait few seconds" commands in between each, so the apps will launch successfully..
    My first question will be whats the easiest script language to do that?
    I tried VBScript but couldn't find commands for open or close apps.. also for controlling files..
    And what commands can do that? I could google them up for better understanding no need for rough guide
    And lastly, does it too hard? If it takes more than hour to make it (learn and process) than it ain't worth it..
    Thanks alot ahead!
    Jordan.

    hmm 2 questions:
    1) taskkill.exe causing me access deny error.. I used "taskkill.exe /IM softwarename.exe"
    how do I get permission or something to fix that?
    2) on the "move" command..
    First, its a "copy" instead.. but I easily figured that out.. 
    but more important is that I want to copy a folder.. with unknown list of way too long files and sub folders..
    and all I see is ability to move a file..
    Is this possible?
    Thanks

  • Need Help creating Icon overlays for my SVN Client

    Hi I am currently writing an cross platform SVN client. I have icon overlay working in windows and linux. This is a small image that sits on top of the normal icon in finder and represents the current state of the file, e.i out of sync, up to date, un-versioned. But am really struggling trying to get it to work in OSX. At this point I only want it to work in snow leopard. This is where I have got to so far.
    I managed to create a QL plugin that worked. The only issue with QL plugins is that you have to specify what file types your plugin works for, (my sample worked for gifs). Unfortunately I don't know that as it needs to work for every file and folder on the system that contains a subfolder called .svn. So with a week of reading I have come to the decision that the only real way around this is to override the QLThumbnailImageCreate function that finder calls and replace it with my own if I find a .svn or call the original if not. However if this is the only route I have not been able to get any code to work that will replace the function with my own.
    If any one can show me an example of switching that function, or has an alternative solution. Or knows the LSItemContentTypes type that means my plugin will fire for every single file, then I would be very happy. I've spent no more than 2 days getting this to work on windows and linux, but I've spent soooo many hours on OSX. Any help would be great.

    DanUK wrote:
    Thanks for your reply etresoft. I know it definitely is possible because the application dropbox does it.
    I'm not so sure. People working on the SC Plugin SVN program have been trying to do that for years. I don't know if they have ever gotten it to work.
    But unfortunately its not open source so I can find out how they did it. The only other way I can do it is to monitor file system changes and then set a custom icon. But this has many draw backs. such as custom icons are persistant and will remain even when my software has been uninstalled.
    I think you should really look into using labels. An SVN/CVS user probably isn't going to be using icon view anyway. Labels will be far more useful in real life. Custom icons are just a gimmick.
    I using QT Creator to write the software so if you fancy a go I can share the project with you.
    Perhaps we should stick to our respective SCM programs. I'm not a fan of QT either

  • Help creating a script for backup

    Hi everybody,
    I would like to make some backups using rman and recovery flash area on oracle10g on my Debian.
    I would like to make a full backup level 0 on Sunday and make incremental backups from Monday to saturday.The best would be to have one for hot backup and one for cold backups.
    But I am wondering how to schedule a task using rman. For example is it possible to write a script that would make the backups at a desired time executed by oracle?
    Or do I have to create a script on unix that should be executed by cron?
    You know I am really bad at scripting, but it would really help me if you could help me creating a script that would make the backup automatically on sunday at midnight and incremental eveydays until sunday.Here is the information I need to put in a script:
    #flash recovery area creation under sqlplus
    SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 10g SCOPE=BOTH SID='*';
    SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/home/oracle/flash_recovery_area' SCOPE=BOTH SID='*';
    #setting the default variable
    ORACLE_SID=iscream;
    #connect to target database:
    rman TARGET SYS/oracle@iscream NOCATALOG
    #set the defaults values for rman
    CONFIGURE DEFAULT DEVICE TYPE TO DISK;
    CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
    CONFIGURE BACKUP OPTIMIZATION ON;
    Any help will be appreciated
    synthese
    hot backup
    using rman
    using flash_recovery_area
    full backup set compressed on sunday
    incremental backup set compressed from mondy to saturday
    using disk
    policy retenttion 7 days
    redondance 2

    You can backup using some unix shell scripts.
    rman is not really good one.

  • Need help with conversion progrma for MTS video files.  Can't download videos from Sony TX-10 camera

    Have new macbook pro 13".  Can't download videos from our Sony TX-10 camera.  I understand I need some kind of conversion program for MTS video files.  Need recommendation for a good conversion program to convert the video files.
    Thanks, chieftd

    Well, sigh, that's not going to work.
    I love how I can do months of research to choose the best camera for my needs and budget, which is NO easy task these days, but surprisingly find it on the unsupported list when it's a very popular camera.  So, while it seems to support a whole bunch of other AVCHD options from Sony, not the NEX cameras.
    The NEX cameras are the latest generation of mirrorless cameras (which, ironically, are great b/c they give dSLR quality still images while actually producing HD video that always records silently and stays in focus b/c it's mirrorless).  The NEX 7 was just reviewed as Camera of the Year.
    Bleh. Oh well. Maybe someday.
    And, for anyone reading, Roxio Toast Titanium did convert it just fine but it took about 20 min or my time to set up a handful of clips and then a couple hours to complete converting them for the quality I was looking for.  One was about 10 minutes of a kids' performance on Christmas and it took a long time. It's just not feasible given how many video clips I do with the camera a week - well, feasible when you consider all the cameras where this would be seamless.
    Thanks for posting your reply - I appreciate it.

  • Need to create a function to receive binary files from Java WebDynpro

    Hey,
    I need to recieve files from java Webdynpro and save them as a file on the backend
    system. After that, the file will be loaded to the documentum.
    In a function module, I only can get the files as a String. Therefore (I think), I need the
    binary file as base64 encoded. Otherwise I can´t get it as a string.
    Now I need to decode it in the backend, but how? I know, there are HTTP-classes
    in newer system, but not in the 4.6C System, I have here.
    Any idea, how I can recieve the files in the function module and transfer it as binary
    file to the backend system?
    If I load a file from the gui with gui_upload, I get the binary file as an internal table
    and can transfer it to the backend filesystem now. Maybe I can get the binary file
    in this way in the function?
    Thank You for Your help!
    Arne

    http://jakarta.apache.org/commons/net/

  • Script for transfer the file from windows to UNIX machine

    Hi expert
    1. I neeed one script that will transfer the files from windows machine to UNIX machine.
    2. And the data updated in Windows file should also be update in UNIX file.
    3. Please send me the steps how can i schedule this script.
    Thanks in advance
    Regards
    Frnd

    It depends on what you need.
    It's possible to use:
    -winscp
    But that means using a program to drag and drop files. This is most commonly used.
    -setup samba on the unix system (the samba package/software needs to available for your unix)
    This requires some setup on the unix system, and your windows system (connect the unix system and put a share defined on the unix system to a driveletter on your windows system), but lets you easily make a batchfile which copies data from one windows drive to another. A batchfile can be scheduled using 'at'.

  • Need help with a script for moving bulk users to another OU and removing/assigning groups

    I've never used PowerShell before and have been asked to track down a script that can move bulk users from one OU to another, and remove and assign new group membership. I've been googling it for about 30 minutes and haven't really gotten anywhere. If
    somebody can point me in the right direction or give some tips I'd greatly appreciate it. I'm sure this kind of task has been done by several people in similar environments I just haven't been able to find those people/examples. 

    Here's what I've got so far...
    Moving to new OU
    CSV constructed like below...
    DN  
                                                                                                                                                    TargetOU
    “CN=John R, OU=BB,OU=ES,OU=Students,OU=OSD,DC=usd233,=DC=local”
                          "OU=PRT,OU=MS,OU=Students,OU=OSD,DC=usd233,DC=local"
    Import-Module activedirectory
    $UserList = Import-Csv "c:\yourCSVhere.csv"
    foreach ($User in $UserList) {
    $User.DN
    $User.TargetOU
    Move-ADObject -Identity $User.DN -TargetPath $User.TargetOU
    Would this work? I also need to remove the user from two groups and add them to two different groups as well. Would I need to use the addUsertoGroups and removeUserfromGroups commands?

  • Need help creating Vector table for specific class

    I am trying to create a Vector table of class Node and I think I understand the concept but in practice I am not
    sure why the compiler complains about non-static reference on statement mv.table.add(new Node(names[n]). Please help. I can not get this thing to work.
    import java.util.*;
    class MyVector {
    Vtable table;
    public static void main(String[] args){
    MyVector mv = new MyVector();
    String names[] = {"one","two","three","four","five"};
    for (int n;n<names.length;n++)
    mv.table.add(new Node(names[n])); //<-ERROR
    table.list();
    if (table.del("de")) System.out.println("deleted");
    table.list();
    public MyVector(){
    System.out.println("MyVector_C");
    table = new Vtable();
    public class Node {
    private String name;
    public Node(){name=new String("Null");}
    public Node(String s){name=s;}
    public void setName(String s){name=s;}
    public String getName(){return name;}
    public String toString(){return "[Node:"+name+"]";}
    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    public void list(){
    Iterator i=v.iterator();
    while (i.hasNext()){System.out.println((Node)i.next());}
    public Boolean del(String s) {
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n = (Node)i.next();
    if (s.equals((String)n.name)) {
    v.remove(n);
    return(true);
    return(false);
    }

    public class Vtable extends Vector {
    private Vector v;
    public Vtable(){v=new Vector();}
    public void add(Node n){v.add(n);}
    public Node getNode(String s){
    Iterator i=v.iterator();
    while(i.hasNext()){
    Node n;
    n = (Node)i.next();
    if (s.equals((String)n.name))
    return(n);
    return null;
    I get ur problem...
    When VTable extends Vector all u have to do is...
    VTable table=new VTable();
    table.add(new node(..));
    There is no need to get the Vector obj in picture as VTable extends Vector...
    I guess, this helps u.

  • Need help with configure script for audacious plugin

    Hello. I have written a small plugin for audacious, that uses an Amarok script to retrieve song lyrics and displays them in a window. I'd like to make an AUR package of it, but I don't even know how to write a configure script. I used to compile it with audacious-plugins, but I suppose a package with all audacious plugins plus my own would be sort of a duplicate of the vanilla audacious-plugins.
    Can anyone help me?

    btn1.addEventListener(MouseEvent.CLICK,f1):
    function f1(e:MouseEvent){
    nextFrame();
    btn2.addEventListener(MouseEvent.CLICK,f2):
    function f2(e:MouseEvent){
    prevFrame();

  • Need help with python script for Deluge

    I am using Deluge 1.3.2 with web server, and all works fine, I use this script in the Deluge settings to execute upon torrent completion:
    #!/bin/bash
    torrentid=$1
    torrentname=$2
    torrentpath=$3
    torrenttimedelta=`/usr/bin/python2 /home/bobby/scripts/deluge/torrentTimeDelta.py $1`
    subject="Started download new torrent!"
    message="$torrentname to $torrentpath"
    echo -e `date`"::Finished downloading torrent:$2 in: $3" with id:$torrentid >> ~/logs/scripts.log
    echo -e `sendEmail -t [email protected] -f [email protected] -u "deluge server notification: torrent $torrentname is complete!" -m "$torrentname has completed downloading at: $torrentpath and took $torrenttimedelta to complete :)" -xu [email protected] -xp password -v -o tls=yes -s email.com` >> ~/logs/scripts.log
    echo ---------------------------------------- >> ~/logs/scripts.log
    This is to email me when a torrent is done and works. What I wanted to add to this email was the time taken to complete the torrent. I have gotten help from Deluge forum in this thread: http://forum.deluge-torrent.org/viewtop … =9&t=36989  However I think it's something with Python within Arch that is the obstacle, and so that helpful person can't do much more IMO. The python script I'm using is:
    #!/usr/bin/python2
    from deluge.ui.client import client
    from twisted.internet import reactor
    d = client.connect()
    def on_connect_success(result):
    print "Connection was successful!"
    def on_get_torrent_value(value):
    for torrent in value:
    print "%s: %s" % (torrent, value[torrent]["name"])
    client.disconnect()
    reactor.stop()
    client.core.get_torrents_status({}, ["name"]).addCallback(on_get_torrent_value)
    d.addCallback(on_connect_success)
    def on_connect_fail(result):
    print "Connection failed!"
    print "result:", result
    d.addErrback(on_connect_fail)
    reactor.run()
    Now if I call this from shell directly, it works. However, including it with my email script at the top, Deluge itself freezes and no email is sent. I run ps aux | grep deluge and I can see that the script has run, but apparently died and all is just hanging. I kill the script process and Deluge resumes just fine, the email is sent. Kinda confused how to remedy this, appreciate any help Thanks
    P.S. When I get the email, the part that says ""$torrentname has completed downloading at: $torrentpath and took $torrenttimedelta to complete "" shows nothing where $torrenttimedelta should be, it just says "and took to complete"

    [edit]  Sorry, I don't use deluge and I messed up my test script. If the script is executable try `/home/bobby/scripts/deluge/torrentTimeDelta.py $1`
    Are there any other errors? or try running bash with debug output to see if it will tell you something else
    The problem you are having is bash doesn't recognize variables inside the tick marks.
    Hope that helps
    Last edited by rickeyski (2011-07-05 19:27:36)

  • Need Help with EEM script for monitoring Rx and Tx load on Link

    Hello,
    I'm trying to implement a script, which monitors the Tx and Rx Load on the Link and sends a syslog in case the load is exceeded 200 mark (i.e If Rx or Tx load > 200)
    I have implemented the following script. But it is not giving the required results.
    event manager applet test
    event interface name Tunnel111 parameter rxload entry-val 200 entry-op gt entry-val-is-increment true poll-interval 5000
    action 1.0 syslog msg "Increase Load On the Link"
    I'm trying to monitor the load on Tunnel 111 which is mapped to WAN interface.
    Router (Cisco 2821) has following IOS
    c2800nm-advipservicesk9-mz.124-25g.bin

    Hello Joseph,
    As per your suggestion, we made some changes in our script and the following script is working fine. Its giving the required syslogs when the load is exceeded.
    event manager applet test
    event interface name Tunnel111 parameter txload entry-val 200 entry-op gt entry-val-is-increment false poll-interval 5
    action 1.0 syslog msg "Increased Load On the Link"
    Your prompt assistance is really appriciated.

  • Need help writing a script to traverse through files in a directory

    I want to go through a directory and sub directories and convert files into jpg ones
    I have this code I've been using: mkdir jpegs; sips -s format jpeg *.png --out jpegs
    This is great for one directory at a time
    But, what I want is to apply this to all sub directories, create a jpeg directory in each of the sub directories and then create jpg's and put them in there
    I'm not sure where to start
    Should I be looking for 'scripting in linux'?
    Thanks
    Omar

    Hello
    You may also try something like this. Set DIR to the root directory to start the search.
    #!/bin/bash
    #     convert png to jpeg and put jpeg in jpegs sub-directory
    DIR=~/Desktop/test
    while read -d $'\0' f
    do
        d=${f%/*}/jpegs
        [[ -d "$d" ]] || mkdir "$d"
        sips -s format jpeg "$f" --out "$d"
    done < <(find "$DIR" -type f -iname '*.png' -print0)
    In case, here's an AppleScript wrapper:
    set f to (choose folder with prompt "Choose root folder to process")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/bin/bash -s <<'EOF' -- " & f's quoted form & "
    #     convert png to jpeg and put jpeg in jpegs sub-directory
    DIR=\"$1\"
    while read -d $'\\0' f
    do
        d=${f%/*}/jpegs
        [[ -d \"$d\" ]] || mkdir \"$d\"
        sips -s format jpeg \"$f\" --out \"$d\"
    done < <(find \"$DIR\" -type f -iname '*.png' -print0)
    EOF"
    Regards,
    H

  • Need help with classpath configuration for external jar files

    We have coded our own JAAS login module, and it uses classes located in jar files, and these jar files were not created using SAP dev studio, e.g. they were provided by a third party vendor as a set of tools.
    So, how do we deploy these jar files so that our SAP JAAS login module can find them ? We found we can run consoleconfig.sh to change the classpath which SAP J2EE engine uses, but we wondered if there was a better way to do this. Of course, if the jar files were created by us, we can include them in the dev studio project and they would be deployed using SDM, and this would not require any changes to classpath using consoleconfig.sh
    Thankyou in advance for your help.

    I noticed nobody has sent any feedback on this yet, so I wondered if I have posted to the wrong forum ? Any thoughts on this ?
    Thanks,
    Tim

  • HT1338 Need help, iPhoto'11 can't read RAW file from Fuji X pro1 camera.

    How to update RAW file from Fuji x pro1 camera into iPhoto'11.

    OS X Mountain Lion: Supported digital camera RAW formats

Maybe you are looking for