Help needed to update CS2-script to CS3

Folks,
I am no good at scripting myself (its on my to-do-list), but a friend of mine has a problem with this script, that wont work in CS3. I know that the syntax is wrong, but am unable to do solve this. Who can help?
var thecount = app.documents.length;
app.changeTextPreferences = NothingEnum.nothing;
app.findTextPreferences = NothingEnum.nothing;
var myDocument = app.activeDocument;
var mysearchitems = ["", "Double Paragraph", "Double Tab", "Double Space", "Para Tab", "Para Space", "? space", "Fullstop Double Space"]
var mychangeitems = ["", "Single Paragraph", "Single Tab", "Single Space", "Para Tab", " Tab", "Fullstop Single Space"]
var theClass = myDocument.selection
if (theClass == ""){
var searchOptions = ["Document"];
else {
var searchOptions = ["Document", "Selection", "Story"];
//now to create the dialog
var myDialog = app.dialogs.add({name:"Masterfoods B - zoek en vervang (© Hans de Bijl)", canCancel:true});
with (myDialog){
with (dialogColumns.add()){
with (borderPanels.add()){
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var myvijffindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var myvijfchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var myzesfindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var myzeschangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var myeighthfindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var myeighthchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var myninthfindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var myninthchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var mytienfindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var mytienchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var myelffindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var myelfchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var mytwaalffindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogColumns.add()){
var mytwaalfchangefield = textEditboxes.add({minWidth:180});
with (borderPanels.add()){
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Zoek:"});
with (dialogColumns.add()){
var mydertienfindfield = textEditboxes.add({minWidth:180});
with (dialogColumns.add()){
staticTexts.add({staticLabel:"Vervang:"});
with (dialogC

Hi Bert,
Find and change in InDesign CS3 changed quite a bit from CS2, and scripting changed as well. Tell your friend to look at the examples of find and change in the Text chapter of the Adobe InDesign CS3 Scripting Guide: JavaScript--you can find the PDF and the associated scripts at:
http://www.adobe.com/products/indesign/scripting/index.html
...and click the Scripting Resources tab.
In brief: the search method was removed, and find and change methods corresponding to the find/change type were added (findText, changeText, findGrep/changeGrep, findGlyph/changeGlyph). The find/change preferences objects were also removed, and preferences objects corresponding to the new find/change types were added (findTextPreferences, changeTextPreferences, findGrepPreferences, changeGrepPreferences, findGlyphPreferences, changeGlyphPreferences).
Thanks,
Ole

Similar Messages

  • Help needed I updated my ipad2 with iOS5 but few of my dashbaords are not working now can any one let me know how to downgrade the OS

    Help needed I updated my ipad2 with iOS5 but few of my dashbaords (HTML5) are not working now ,can any one let me know how to downgrade the OS as we have a meeting coming up .. its urgent

    Downgrading the iOS is not supported. If you are using Safari this try clearing its cache via Settings > Safari.
    If that doesn't work then try closing Safari completely and then re-open it : from the home screen (i.e. not with Safari 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Safari app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    A third option is a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Help needed uninstalling PS CS2 & CS3

    Hi, I have PS v7, CS2 & Creative Suite 3 design Premium on my late 2004 Mac iBook.
    After I installed Creative suite I used it for a short while then got the message Licencin for this product has stopped working, usinstall & reinstall.
    I did this 3 times & still got the same error message. I'm not sure if it's always after updating or even before.
    I needed to use PS while CS3 was stuck like that & so I opened CS2 & got the message Serious error has been detected. To continue using PS pls. uninstall & reinstall.
    I'm looking at this page
    http://kb.adobe.com/selfservice/viewContent.do?externalId=331404
    & have trashed all the files mentioned that I have except
    3. Delete the Adobe folder from the Users/[User]/Library/Application Suppor
    This folder has 19 items in including a Lightroom folder & an XMP folder that I'm thinking I might miss if I delete. Shall I delete all but these?
    I've read I have to install CS2 1st before CS3 so I started uninstalling CS2 1st but I think if I uninstal CS3 with it's nice installer I can see what's left in this folder.
    Any help appreciated.
    Thanks.

    After running the uninstaller for CS3 there are still 19 items in that Adobe folder in Applications support folder including one called Adobe Photoshop CS3 & another called Bridge CS3. The uninstaller didn't remove Acrobat 9 which had a separate install disc. There is also an Acrobat folder in that Adobe folder & an Air folder & a CS3 stock photos folder.
    There is also an adobe photoshop CS3 folder still in my applications folder with plugins & samples inside.
    I'm thinking to trash everything with CS3 in the name & leave the rest & hope it doesn't matter if some belong to CS2.
    Any advice?

  • JS: Using CS2 Scripts with CS3

    We're getting ready to (finally) upgrade from InDesign CS2 to CS3. We use several scripts (Javascript) regularly. I know quite a bit changed with the object model in CS3. I've seen a couple of threads here where Olav mentions "script versioning" that allows you to reference the old object model, but I haven't been able to find HOW to do that.
    I want to upgrade all of our scripts to the CS3 model, but that will take some time, as I am no expert. Is there a way to use our CS2 scripts just as they are for now (until I'm able to get them all updated)?
    Thanks,
    Lisa

    That script won't see any styles that are in style groups in CS3 -- is that the problem?
    Or it could be that the effect of simply reasserting the style in CS3 is different from CS/CS2. I don't remember.
    Dave

  • Help needed with Update statements.

    Hello All,
    I am trying to learn Berkeley XMLDB and facing problem to query the inserted XML file. I have a small XML file with the following contents:
    <?xml version="1.0" standalone="yes"?>
    <Bookstore>
    <Book>
    <book_ID>1</book_ID>
    <title>Harry Potter and the Order of the Phoenix</title>
    <subtitle>A Photographic History</subtitle>
    <author>
    <author_fname>J.K.</author_fname>
    <author_lname>Rowling</author_lname>
    </author>
    <price>9.99</price>
    <year_published>2004</year_published>
    <publisher>Scholastic, Inc.</publisher>
    <genre>Fiction</genre>
    <quantity_in_stock>28997</quantity_in_stock>
    <popularity>20564</popularity>
    </Book>
    </Bookstore>
    When I try to update the TITLE of this node I have the following error message:
    C:\Users\Chandra\Desktop\BDB>javac -classpath .;"C:\Program Files\Sleepycat Soft
    ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
    erkeley DB XML 2.1.8\jar\db.jar" bdb.java
    bdb.java:75: illegal start of expression
    public static final String STATEMENT1 = "replace value of node collection("twopp
    ro.bdbxml")/Bookstore/Book/bookid/title with 'NEWBOOK'";
    ^
    bdb.java:80: ')' expected
    System.out.println("Done query: " + STATEMENT1);
    ^
    2 errors
    But when I remove the update statements and just try to display the TITLE of this node, I dont see any outputs. Please help me to catch up with my mistakes. Below is source code I am using to run this functionality.
    Thanks.
    import java.io.File;
    import java.io.FileNotFoundException;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlInputStream;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlUpdateContext;
    import com.sleepycat.dbxml.XmlDocument;
    import com.sleepycat.dbxml.XmlQueryContext;
    import com.sleepycat.dbxml.XmlQueryExpression;
    import com.sleepycat.dbxml.XmlResults;
    import com.sleepycat.dbxml.XmlValue;
    public class bdb{
    public static void main(String[] args)
    Environment myEnv = null;
    File envHome = new File("D:/xmldata");
    try {
    EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exits, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    envConf.setRunRecovery(true);
    // subsystem.
    myEnv = new Environment(envHome, envConf);
    // Do BDB XML work here.
    } catch (DatabaseException de) {
    // Exception handling goes here
    } catch (FileNotFoundException fnfe) {
    // Exception handling goes here
    } finally {
    try {
    if (myEnv != null) {
    myEnv.close();
    } catch (DatabaseException de) {
    // Exception handling goes here
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    // The document
    String docString = "D:/xmldata/test.xml";
    // The document's name.
    String docName = "cia";
    try {
    myManager = new XmlManager(); // Assumes the container currently exists.
    myContainer =
    myManager.createContainer("twoppro.bdbxml");
    myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
    XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
    XmlInputStream theStream =
    myManager.createLocalFileInputStream(docString); // Do the actual put
    myContainer.putDocument(docName, // The document's name
    theStream, // The actual document.
    theContext, // The update context
    // (required).
    null); // XmlDocumentConfig object
    theStream.delete();
    // Update the title
    public static final String STATEMENT1 = "*replace value of node collection("twoppro.bdbxml")/Bookstore/Book/[bookid=1]/title with 'NEWBOOK'";*
    XmlQueryContext context = myManager.createQueryContext();
    XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
    System.out.println("Try to execute query: " +
    System.out.println("Done query: " + STATEMENT1);
    queryExpression1.execute(context);
    // Get a query context
    XmlQueryContext context = myManager.createQueryContext();
    // Set the evaluation type to Lazy.
    context.setEvaluationType(XmlQueryContext.Lazy);
    // Declare the query string
    String queryString =
    "for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
    + "*return $u/title";*
    // Prepare (compile) the query
    XmlQueryExpression qe = myManager.prepare(queryString, context);
    XmlResults results = qe.execute(context);
    System.out.println("ok");
    System.out.println(results);
    } catch (XmlException e) {
    // Error handling goes here. You may want to check
    // for XmlException.UNIQUE_ERROR, which is raised
    // if a document with that name already exists in
    // the container. If this exception is thrown,
    // try the put again with a different name, or
    // use XmlModify to update the document.
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here

    Thanks Rucong. The change you suggested did helped me to run the program correct. But I also have the display function to retrive the results and my program is parsed without any output.
    C:\Users\C\Desktop\BDB>Clientbuild.bat
    C:\Users\C\Desktop\BDB>javac -classpath .;"C:\Program Files\Sleepycat Soft
    ware\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\B
    erkeley DB XML 2.1.8\jar\db.jar" bdb.java
    C:\Users\C\Desktop\BDB>Client.bat
    C:\Users\C\Desktop\BDB>java -classpath .;"C:\Program Files\Sleepycat Softw
    are\Berkeley DB XML 2.1.8\jar\dbxml.jar";"C:\Program Files\Sleepycat Software\Be
    rkeley DB XML 2.1.8\jar\db.jar" bdb
    See there is no OUPUT displayed. Is there somethinglike a 'print' I have to use in this java code.
    Any ideas ? Below is the code I am using now
    import java.io.File;
    import java.io.FileNotFoundException;
    import com.sleepycat.db.DatabaseException;
    import com.sleepycat.db.Environment;
    import com.sleepycat.db.EnvironmentConfig;
    import com.sleepycat.dbxml.XmlContainer;
    import com.sleepycat.dbxml.XmlException;
    import com.sleepycat.dbxml.XmlInputStream;
    import com.sleepycat.dbxml.XmlManager;
    import com.sleepycat.dbxml.XmlUpdateContext;
    import com.sleepycat.dbxml.XmlDocument;
    import com.sleepycat.dbxml.XmlQueryContext;
    import com.sleepycat.dbxml.XmlQueryExpression;
    import com.sleepycat.dbxml.XmlResults;
    import com.sleepycat.dbxml.XmlValue;
    public class bdb{
    public static void main(String[] args)
    Environment myEnv = null;
    File envHome = new File("D:/xmldata");
    try {
    EnvironmentConfig envConf = new EnvironmentConfig();
    envConf.setAllowCreate(true); // If the environment does not
    // exits, create it.
    envConf.setInitializeCache(true); // Turn on the shared memory
    // region.
    envConf.setInitializeLocking(true); // Turn on the locking subsystem.
    envConf.setInitializeLogging(true); // Turn on the logging subsystem.
    envConf.setTransactional(true); // Turn on the transactional
    envConf.setRunRecovery(true);
    // subsystem.
    myEnv = new Environment(envHome, envConf);
    // Do BDB XML work here.
    } catch (DatabaseException de) {
    // Exception handling goes here
    } catch (FileNotFoundException fnfe) {
    // Exception handling goes here
    } finally {
    try {
    if (myEnv != null) {
    myEnv.close();
    } catch (DatabaseException de) {
    // Exception handling goes here
    XmlManager myManager = null;
    XmlContainer myContainer = null;
    // The document
    String docString = "D:/xmldata/test.xml";
    // The document's name.
    String docName = "cia";
    try {
    myManager = new XmlManager(); // Assumes the container currently exists.
    myContainer =
    myManager.createContainer("twoppro.bdbxml");
    myManager.setDefaultContainerType(XmlContainer.NodeContainer); // Need an update context for the put.
    XmlUpdateContext theContext = myManager.createUpdateContext(); // Get the input stream.
    XmlInputStream theStream =
    myManager.createLocalFileInputStream(docString); // Do the actual put
    myContainer.putDocument(docName, // The document's name
    theStream, // The actual document.
    theContext, // The update context
    // (required).
    null); // XmlDocumentConfig object
    theStream.delete();
    // Update the title
    String STATEMENT1 = "for $n in collection('twoppro.bdbxml')/Bookstore/Book[book_ID=1]/title return replace value of node $n with 'NEWBOOK'";
    XmlQueryContext context = myManager.createQueryContext();
    XmlQueryExpression queryExpression1 = myManager.prepare(STATEMENT1, context);
    System.out.println("Done query: " + STATEMENT1);
    queryExpression1.execute(context);
    // Get a query context
    XmlQueryContext thiscontext = myManager.createQueryContext();
    // Set the evaluation type to Lazy.
    context.setEvaluationType(XmlQueryContext.Lazy);
    // Declare the query string
    String queryString =
    "for $u in collection('twoppro.dbxml')/Bookstore/Book/[bookid=1]"
    + "return $u/title";
    // Prepare (compile) the query
    XmlQueryExpression qe = myManager.prepare(queryString, thiscontext);
    XmlResults results = qe.execute(thiscontext);
    System.out.println("ok");
    System.out.println(results);
    } catch (XmlException e) {
    // Error handling goes here. You may want to check
    // for XmlException.UNIQUE_ERROR, which is raised
    // if a document with that name already exists in
    // the container. If this exception is thrown,
    // try the put again with a different name, or
    // use XmlModify to update the document.
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } finally {
    try {
    if (myContainer != null) {
    myContainer.close();
    if (myManager != null) {
    myManager.close();
    } catch (XmlException ce) {
    // Exception handling goes here
    Thanks.

  • Help needed with Popcorn Island Script

    Hey all, I am trying to use this script so I can transfer over my FCP files to AE. I have watched the tutorial but it doesn't show you how to install the script. I'm asked for a language and I'm not sure what I need to be using or where to go from there. The link for the download is below if it helps.
    Anyone with experience in this that can help is greatly appreciated.
    http://www.popcornisland.com/after-effects/final-cut-2-after-effects/
    Cheers
    GK

    Just move the script into the relevant AE script folder. You will see the script in the dropdown list when you select File/Scripts within AE.
    You don't need to "run" the script outside of AE. (The only reason I can think that you have been asked for a language is that you have double-clicked on the script and opened the programme, ExtendScript Toolkit. There's no reason to do this.)
    Frank

  • Help needed with a PS script for network share documentation

    I found a nice PS script that will do what I want, however the output portion seems to be broken. It will output the permissions and details, but not list what share it is referring to... Can anyone help with this?
    Thanks!
    https://gallery.technet.microsoft.com/scriptcenter/List-Share-Permissions-83f8c419#content
    <# 
               .SYNOPSIS  
               This script will list all shares on a computer, and list all the share permissions for each share. 
               .DESCRIPTION 
               The script will take a list all shares on a local or remote computer. 
               .PARAMETER Computer 
               Specifies the computer or array of computers to process 
               .INPUTS 
               Get-SharePermissions accepts pipeline of computer name(s) 
               .OUTPUTS 
               Produces an array object for each share found. 
               .EXAMPLE 
               C:\PS> .\Get-SharePermissions # Operates against local computer. 
               .EXAMPLE 
               C:\PS> 'computerName' | .\Get-SharePermissions 
               .EXAMPLE 
               C:\PS> Get-Content 'computerlist.txt' | .\Get-SharePermissions | Out-File 'SharePermissions.txt' 
               .EXAMPLE 
               Get-Help .\Get-SharePermissions -Full 
    #> 
    # Written by BigTeddy November 15, 2011 
    # Last updated 9 September 2012  
    # Ver. 2.0  
    # Thanks to Michal Gajda for input with the ACE handling. 
    [cmdletbinding()] 
    param([Parameter(ValueFromPipeline=$True, 
        ValueFromPipelineByPropertyName=$True)]$Computer = '.')  
    $shares = gwmi -Class win32_share -ComputerName $computer | select -ExpandProperty Name  
    foreach ($share in $shares) {  
        $acl = $null  
        Write-Host $share -ForegroundColor Green  
        Write-Host $('-' * $share.Length) -ForegroundColor Green  
        $objShareSec = Get-WMIObject -Class Win32_LogicalShareSecuritySetting -Filter "name='$Share'"  -ComputerName $computer 
        try {  
            $SD = $objShareSec.GetSecurityDescriptor().Descriptor    
            foreach($ace in $SD.DACL){   
                $UserName = $ace.Trustee.Name      
                If ($ace.Trustee.Domain -ne $Null) {$UserName = "$($ace.Trustee.Domain)\$UserName"}    
                If ($ace.Trustee.Name -eq $Null) {$UserName = $ace.Trustee.SIDString }      
                [Array]$ACL += New-Object Security.AccessControl.FileSystemAccessRule($UserName, $ace.AccessMask, $ace.AceType)  
                } #end foreach ACE            
            } # end try  
        catch  
            { Write-Host "Unable to obtain permissions for $share" }  
        $ACL  
        Write-Host $('=' * 50)  
        } # end foreach $share
    This is what the output looks like when ran with 'RemoteServer' | .\Get-SharePermissions.ps1 | Out-File 'sharepermissions.xls'
    FileSystemRights  : Modify, Synchronize
    AccessControlType : Allow
    IdentityReference : Everyone
    IsInherited       : False
    InheritanceFlags  : None
    PropagationFlags  : None

    Actually it is not being written only with Write-Host.  The last line of the loop is this "$ACL"  which ius an array of objects. 
    Here is a version that gets the info more easily and produces flexible objects.  It should be easier to modify into what is needed.
    # Get-ShareSec.ps1
    [cmdletbinding()]
    param(
    [Alias('ComputerName')]
    [Parameter(
    ValueFromPipelineByPropertyName=$True
    )]$Name=$env:COMPUTERNAME
    Process {
    Write-Verbose "Computer=$name"
    $shares =Get-WMiObject Win32_Share -ComputerName $name -Filter 'Type=0' -ea 0
    foreach($share in $shares){
    $sharename=$share.Name
    Write-Verbose "`tShareName=$sharename"
    $ShareSec = Get-WMIObject -Class Win32_LogicalShareSecuritySetting -Filter "name='$ShareName'" -ComputerName $name
    try {
    foreach ($ace in $ShareSec.GetSecurityDescriptor().Descriptor.DACL) {
    $props=[ordered]@{
    ComputerName=$name
    ShareName=$sharename
    TrusteeName=$ace.Trustee.Name
    TrusteeDomain=$ace.Trustee.Domain
    TrusteeSID=$ace.Trustee.SIDString
    New-Object PsObject -Property $props
    catch {
    Write-Warning ('{0} | {1} | {2}' -f $Computer,$sharename, $_)
    Get-Adcomputer -Filter * | .\Get-ShareSec.ps1 -v
    ¯\_(ツ)_/¯

  • Help needed with creating a script

    This is what I try to achieve:
    Creating sequentially numbered files (any files) by dragging the original to a folder.
    It should work like this:
    drag a file ( i.e. myphoto.jpg) to a folder and the script attached to that folder would duplicate the file and number it (myphoto001.jpg)
    I can't get it to work... does anyone know of a ready-made script or is willing to advise on how-to?
    Thanks for feedback.

    Hello
    Here's some script you may try.
    (Copy code from this web page, not from subscribed email text, for I escaped some characters for posting.)
    Broadly speaking, it will do what you wish. But not exactly as you described.
    A few things to note.
    • It will rename file 'image1.jpg' to 'image1.001.jpg', e.g., (note period between 'image1' and '001') in order to make script simple.
    (If the file name is 'image1' without extension, it will be renamed to, e.g., 'image1.001._' by adding dummy extension '_' in order to make script simple and consistent)
    • It will move the file that is drag-n-dropped to the Folder Actioned folder A to an inner sub-folder B and rename the file in B. This is because renaming file in A will trigger the Folder Action, which detects renamed file as newly added file (under OSX), that is problematic.
    • If the following script is used as Folder Action, you'll have to drag-n-drop the file with option key down to copy it to the Folder Actioned folder. Without option key held down, the original file will be moved to the folder.
    (If the source and destination volumes are different, drag-n-drop will copy the file and there will be no need to use option key. E.g. If Folder Actioned folder resides in an external volume and original files are in an internal volume, simple drag-n-drop will copy the files.)
    Please see comments in script for more details.
    Hope this may help.
    H
    --SCRIPT
      Assumptions and behaviours:
        1) The destination folder B where renamed items are stored is in a root folder A.
          • A is determined as the folder where this Folder Action is attached or this droplet resides; and
          • B's name is given as property destinationFolderName in main().
        2) Target file F is moved to B and renamed such that -
          if original name of F is "P.R" (P = name stem, R = extension) and
          the max seq. number in name of the file(s) in B which has the same name stem and extension as F is M,
          F is renamed as "P.Q.R", where Q = M + 1.
          • Number format is given as property numberFormat in main().
          e.g. File named "name1.jpg" will be renamed to "name1.003.jpg",
            if file named "name1.002.jpg" in destination has the max seq. number with the same name stem and extension.
      Usage:
        1) As Folder Action,
          • save this as compiled script and attached it to folder A; and
          • drag-n-drop target files into A and it will move them in folder B and rename them as intended.
          (Use option-drag-n-drop (i.e. copy, not move) to keep the original file or it will be moved and renamed.)
        2) As droplet,
          • save this as application (or application bundle) in folder A; and
          • drag-n-drop target files onto the droplet and it will duplicate them to folder B and rename them as intended.
          (Exception. If target files are in A, they will be moved, not copied, to folder B.)
    on adding folder items to da after receiving aa
    main(da, aa)
    end adding folder items to
    on open aa
    tell application "Finder" to set da to container of (path to me) as alias
    main(da, aa)
    end open
    on main(ra, aa)
      alias ra : root folder
      list aa : items to be processed
    script o
    property destinationFolderName : "Renamed items"
    property numberFormat : "000" -- seq. number will be 001, 002, etc (if n > 999, use n as is)
    property nlen : count numberFormat
    property nmax : (10 ^ nlen - 1) as integer
    property xx : {}
    property astid : a reference to AppleScript's text item delimiters
    property astid0 : astid's contents
    property NL : return
    property errs1 : NL & NL & "This item will be left as is in: " & NL & NL
    property errs2 : NL & NL & "This item will be left as: " & NL & NL
    property btt1 : {"OK"}
    on decomp(s)
      string s : name string to decompose
      return list : {name stem, sequential number string, name extension}
      e.g. Given s : result
        "name1.001.jpg" : {"name1", "001", "jpg"}
        "name1.jpg" : {"name1", {}, "jpg"} -- [*]
        "name1" : {"name1", {}, {}}
        "name1..jpg" : {"name1", "", "jpg"} -- [*]
        "name1.name2.001.jpg" : {"name1.name2", "001", "jpg"}
        "name1.name2.jpg" : {"name1.name2", {}, "jpg"}
      [*] Note different meanings of {} and "" in result list
    local n, p, q, r
    try
    if s = "" then return {{}, {}, {}}
    set astid's contents to {"."}
    set s to s's text items
    tell s to set {n, r} to {reverse's rest's reverse, item -1}
    if n = {} then set {n, r} to {s, {}}
    tell n to set {p, q} to {reverse's rest's reverse, item -1}
    if p = {} then set {p, q} to {n, {}}
    try
    q as number
    set p to "" & p
    on error
    set {p, q} to {"" & (p & q), {}}
    end try
    set astid's contents to astid0
    on error errs number errn
    set astid's contents to astid0
    error "decomp():" & errs number errn
    end try
    return {p, q, r}
    end decomp
    on nextname(n)
      string n : source name
      property xx : names in pool
      property numberFormat, nlen, nmax: number format string, its length, max value respectively
      return string : new name with next sequential number
      e.g.
        Provided that n = "name1.jpg" and the name that has max seq. number
         with the same stem and extension as n in destination folder is "name1.005.jpg",
         resurt = "name1.006.jpg"
    local p, q, r, a, b, c, b1
    set {p, q, r} to decomp(n)
    if r = {} then set r to "_" -- give dummy extension if none (to handle it correctly)
    set b1 to 0
    repeat with x in my xx
    set x to x's contents
    if x starts with p then
    set {a, b, c} to decomp(x)
    if {a, c} = {p, r} then
    set b to 0 + b
    if b > b1 then set b1 to b
    end if
    end if
    end repeat
    set b1 to b1 + 1
    if b1 > nmax then
    return p & "." & b1 & "." & r
    else
    return p & "." & (numberFormat & b1)'s text -nlen thru -1 & "." & r
    end if
    end nextname
    try
    set da to (ra as Unicode text) & destinationFolderName & ":" as alias
    on error -- da not present
    tell application "Finder" to ¬
    set da to (make new folder at ra with properties {name:destinationFolderName}) as alias
    end try
    --set my xx to list folder da without invisibles -- this is faster but 'list folder' is deprecated in AS2.0.
    tell application "Finder" to set my xx to name of items of da as vector -- [1]
      [1] Finder (at least under OS9) returns [] (empty linked list) when returning empty list.
      This will cause error -10006 in 'set end of my xx to ...' statement, for linked list does not support it.
      The explicit 'as vector' will handle this case.
    repeat with a in aa
    set a to a's contents
    --set n to (info for a)'s name -- this is faster but 'info for' is deprecated under OSX10.5
    tell application "Finder" to set n to a's name
    if n = destinationFolderName then -- ignore it
    else
    set {n1, _step} to {nextname(n), 0}
    tell application "Finder"
    set sa to a's container as alias
    -- move or duplicate
    try
    if sa = ra then
    (* when run as Folder Action (or as droplet with items in ra) *)
    set a1 to (move a to da) as alias
    else
    (* when run as droplet with items outside ra *)
    set a1 to (duplicate a to da) as alias
    end if
    set _step to 1
    on error errs number errn
    (* name conflict, etc *)
    display dialog errs & " " & errn & errs1 & sa buttons btt1 ¬
    default button 1 with icon 2 giving up after 15
    end try
    -- rename
    try
    if _step = 1 then set {a1's name, _step} to {n1, 2}
    on error errs number errn
    (* name conflict, invalid name, etc; not probable but possible *)
    display dialog errs & " " & errn & errs2 & a1 buttons btt1 ¬
    default button 1 with icon 2 giving up after 15
    end try
    end tell
    if _step = 2 then set end of my xx to n1
    end if
    end repeat
    end script
    tell o to run
    end main
    --END OF SCRIPT
    Message was edited by: Hiroto (fixed typo)

  • Help needed with update from 3GS

    I have an iPhone 3GS and am trying to update the software to ISO 4.. I have followed all the usual steps and connected my iPhone to iTunes and clicked update and all it says is that my iTunes software is up to date at 9.1.. But on the summary page it stills says that my iPhone software is 3.1.. How am I meant to update it? Help!

    You need to click on your device in iTunes to bring up the iPhone summary page. It if from there that you update your iPhone software.
    Message was edited by: gdgmacguy

  • I Need to Update CS2 Trial Key to Full Key

    I have several users who are on CS2 trial keys which are going to expire at the end of the month. Does anyone know of a way I can update them with the full licence without uninstalling? Ideally I would like to roll out the updated key via SCCM (SMS). Also, is there a way to find out which key a machine has got remotely? By this I am talking about a text file, reg entry, etc, not the splash screen/help menu.
    Thanks in advance.

    I can't believe Adobe would agree to extending CS2 to anybody. I'm sure they <br />thought you were trialling CS4.<br /><br /><[email protected]> wrote in message <br />news:[email protected]..<br />>I know and we're moving to CS4 shortly but for reason I can't be bothered <br />>going into now, we have to keep with CS2 for another month or so. Part of <br />>the deal made with Adobe was that they provided us with some extended trial <br />>licences for some machines with a view to going to CS4 in due course.<br />> Hey, not my idea, causes me no end of pain, but there you have it. I'm <br />> tasked with just keeping these working for another month or so (and we <br />> have the full licences anyway).

  • Help needed on update rules Coding

    Hi BW Gurus.
    Please help me out.
    I am working on BI 7.0
    This is my scenario.I need to take a project cost report.
    There are some projects in cProjects and some projects in R/3 (Project System).
    Each project in cProjects is linked with one or more projects in R/3.
    They are linked by means of GUID.Now I need to pull out a report from a infocube(Z infocube) which has information both from R/3 and cProjects.I built a Z infocube.
    Here comes my problem.
    I need to write update rule for the requirement explained below.
    For all the projects(in cProjects) I need to find its GUID from the table-DPR_PROJECT . These GUIDs are contained in this table under the field name GUID.
    The same GUID numbers I can find it in another table-DPR_OBJLINK under the field PROJECT_GUID. For this PROJECT_GUID numbers, I need to identify the corresponding EXTERNAL_ID(this field is in the table-DPR_OBJLINK) of the projects(These projects are R/3 projects). These EXTERNAL_ID values has to be pulled out in the report.
    I am using the extractor 0CO_OM_WBS_1.
    Please help me out with the update rule code.
    Please help me out as soon as possible.
    Its really urgent my dear friends
    Thanks in Advance,
    Have a nice day
    Regards,
    Sam Mathew

    Hi Raogovind,
    For which state are you customising this Professional Tax? Professional Tax wage type is /422.
    The system determines the professional tax payable by an employee, based on the following factors:
    Professional tax basis u2013 Comprises those salary components on which a professional tax is applicable. The salary components to be included for calculating the professional tax basis depend on the state. The different components are:
    Basic pay
    Dearness allowance
    Medical reimbursement perquisite
    Housing
    Profits in lieu of salary
    Other remuneration that an employee receives regularly
    Bonus
    It is depending on the combination of the Personnel Area, Personnel sub area and the professional tax grouping of the employee, that the system identifies factors such as the:
    Components of the professional tax basis.
    Method and the frequency of calculating and deducting professional tax.
    Hope this information helps you solve the issue.
    Edited by: chandra.saphr on Aug 6, 2009 7:10 AM

  • Help need on Update rules

    Hi BW Gurus.
    Please help me out.
    I am working on BI 7.0
    This is my scenario.I need to take a project cost report.
    There are some projects in cProjects and some projects in R/3 (Project System).
    Each project in cProjects is linked with one or more projects in R/3.
    They are linked by means of GUID.Now I need to pull out a report from a infocube(Z infocube) which has information both from R/3 and cProjects.I built a Z infocube.
    Here comes my problem.
    I need to write update rule for the requirement explained below.
    For all the projects(in cProjects) I need to find its GUID from the table-DPR_PROJECT . These GUIDs are contained in this table under the field name GUID.
    The same GUID numbers I can find it in another table-DPR_OBJLINK under the field PROJECT_GUID. For this PROJECT_GUID  numbers, I need to identify the corresponding EXTERNAL_ID(this field is in the table-DPR_OBJLINK) of the projects(These projects are R/3 projects). These EXTERNAL_ID values has to be pulled out in the report.
    I am using the extractor 0CO_OM_WBS_1.
    I am not sure if I am giving enough information with my question.
    Please help me out with the update rule code.
    Thanks in Advance,
    Have a nice day
    Regards,
    Sam Mathew

    try this one:
    tables  /BI0/MROUTE.
    if COMM_STRUCTURE-route is initial.
    RESULT = 0.
    else.
    SELECT single * from /BI0/MROUTE
    where route = COMM_STRUCTURE-ROUTE and
      OBJVERS = 'A'.
    if sy-subrc = 0.
    RESULT = /BI0/MROUTE-/BIC/ZLEADDAYS.
    endif.
    ENDIF.
    Hope it helps!
    Bye,
    Roberto

  • Help needed on updating

    My Ipod crashed, tried everything on the help site, but it didnt work so i sent it in for a service. A new Ipod arrived today so I tried to update the settings. On getting to the IPOD updater screen, when I connect the IPOd it says iPod updater 2004-08-06 cannot install firmware on connected Ipod. The Ipod s hardware and and the updater firmware are incompatible. I have been to the download updater page, but I cant find an icon to let me update. Please help

    Emma,
    I'm sorry for all the trouble you are having. I am fairly new here in the discussions so I don't know all the trick.
    I do have open another page with the link address I gave you. The page is headed "Get new ipod updater". Below that is a section asking for apple id & password followed by an area to open account if you have not already and finally below that is the download box to check. If that doesn't work then we will have to wait for one with better knowlege than mine to help. There are a lot of great people on the discussions. They helped me in my time of need.
    Good Luck Again!

  • Help Needed! - Updating Windows 8 to 8.1

    Hi!
    I just purchsed refurburshed HP Envy x2 Model with windows 8 (32 bit) installed.
    After downloading all windows 8 updates, I'm trying to update widows 8.1 for the last one week, however, windows update restart from 0%  after downloading upto 22%.  This happend 4- 5 times due to which I'm stuck (and also lost data bandthwidth of my montly plan).
    I need help on following issues:
    1. How can I update 100% windows.  (I've already tried microsoft patches availabel for troubleshooting windows update
    2. I there any way to clean install windows 8.1 through USB. (Cannot boot from USB)
    3. After updateing windows 8.1  Can I change/update  recvoery partition to windows 8.1 instead of factory default windows 8 recovery.
    Looking forward some concrete professional assistance please.
    Best Regards,
    Irfan 

    Hi @irrffan ,
    I have brought your issue to the attention of an appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post serial numbers and case details.
    If you are unfamiliar with how the Forum's private message capability works, this post has instructions.
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • Help needed to update my software on the I pad

    I am trying to update my I pad software via I tunes but I am getting the message 'I pad software could not be contacted. Make sure your network settings are correct and your network connection is active' HELP I have no idea what this means

    You might also check out this article.  There also is a link on the bottom of this article to another article that discusses the issues Stedman refers to. 
    http://support.apple.com/kb/TS1814?viewlocale=en_US&locale=en_US

Maybe you are looking for

  • Creative Zen 32GB - connection problem with 2nd PC

    Can anyone help? Have had my ZEN for 2 years now & (touch wood) it's still going well. I want to be able to upload music from my laptop when I'm away so I installed the software & registered it without any problem. However my laptop can't detect the

  • Free Goods Analysis/Report

    Dear Experts, I would like to generate a report to view all key combinations maintained for free goods. Is there a standard configuration to set up Free Goods report like Pricing Report (V/LA)? If I go to transaction VBN1 and select Condition Info, I

  • Download Internal Table in CSV format it gets downloaded in single column

    Hi All I am converting Internal Table in CSV format using the FM CONVERT TO CSV FORMAT and then downloading data using GUI_DOWNLOAD FM. I have given separator as ','. However when I download the data the file is opened in Excel and first 2 to 3 colum

  • Comes With Music membership extension

    I have been a satisfied (most of the time) subscriber to Comes With Music membership (UK) since 26 Ocbober 1969. On 26 September 2010 I got an e-mail from "The Comes With Music team" ([email protected]) which I have pasted below. --------

  • Zen V - Do I have to install the softwa

    I just want my year old to drag music files from the cd or my hard dri've to the Zen. Can I use WinXP to delete/format the Zen and then just copy music to it using Windows Explorer. Thanks - L.