[JS] Variable in the path of the file date

Hello

I have a simple script that updates the files on the page.

var myDate = new Date();

var myDay = myDate.getDate ();

var myMonth = myDate.getMonth () + 1;

var myYear = myDate.getFullYear ();

myTotal = myDay var + ' / ' + myMonth + ' / ' + myYear;

myDoc var = app.activeDocument;

aFile var file = ("/ files/max/Desktop /'myTotal'_name.txt") > > > >could you please someone suggest how I can use the variable myTotal - as a prefix for the name of the file? I need to open the files with effective date

BFILE var = File("/Files/max/Desktop/b.txt")

CFile var = File("/Files/Max/Desktop/c.txt")

If (! afile.exists:! bfile.exists:! cfile.exists)

{

Alert ("file missing text... »)

}

on the other

{

myDoc.textFrames.item("a").parentStory.insertionPoints.item (-1) .place (afile);

myDoc.textFrames.item("b").parentStory.insertionPoints.item (-1) .place (bfile).

myDoc.textFrames.item("c").parentStory.insertionPoints.item (-1) .place (cfile);

}

Thank you

The leader (...) argument is a simple text string, and simple text strings are concatenated using the operator +:

a = « b » ;

b = « c » ;

c = a + b; -> c = « CB » ;

You are complicating things by mixing single and double quotes. JavaScript accepts, but the same as those must be used to open and close a channel.

Instead of

(' / Files/max/Desktop /"myTotal"_name.txt ")

use

(' / Files/max/Desktop / "" +myTotal + ""_name.txt ")

Furthermore, as you can see in your own line of leader (.), the forward slash is defined as a path separator. It is possible that you have a folder structure "Files", containing "max", containing "Desktop", but as you add "myTotal" to the mixture - which also contains slashes - please make sure that all elements of the path in that also exist.

(As it seems you didn't intend, I suggest use of date separators other than the slashes, forward - or backward-.)

Tags: InDesign

Similar Questions

  • How can I recharge my favorites if I can't find the file "date.json" in my backup?

    My hard drive crashed and everything had to be recovered and reinstalled. I have a data folder Firefox but can not find the file "date.json" which is indicated to open the troubleshooting instructions. Y at - it another option?

    Hello

    If you have the latest version of Firefox, the file places.sqlite is what keeps your bookmarks. See the article for recovery of data from an old profile for more information.

  • ORA-19504: cannot create the file '+ DATA '.

    Hello everyone.

    This is the scenario:

    We have a test server that is used to restore daily backups of the Production database. Restore us the database with the same SID as the production one.

    For specific reasons, we need create a second database (with a different SID) on this server with an older backup from the production one. To realize that I'm trying to use a part of the "DUPLICATE without connection to the target" tutorials on the web.

    I tried the simple guide that I found which is:

    (1) copy the backup files cold /somedirectory

    (2) start OLD database with nomount

    (3) connect RMAN with OLDER as an auxiliary

    (4) run the following: DUPLICATE DATABASE FOR OLD BACKUP LOCATION ' / somedirectory' NOFILENAMECHECK.

    Here's the result (I deleted some lines because of the size of it):

    ----------------------

    RMAN > ProdDB to OlderDB DUPLICATE DATABASE

    2 > LOCATION of BACKUP "/ home/oracle/OlderBackupFiles.

    3 > NOFILENAMECHECK.

    4 >

    From October 1, 14 Db double

    content of Script memory:

    {

    clone of SQL 'alter system set control_files =

    "+DATA/OlderDB/controlfile/current.829.859839217" comment =

    ' Set by RMAN "scope = spfile;

    clone of SQL 'alter system set = db_name

    "ProdDB" comment =

    ' Modified by RMAN duplicate "scope = spfile;

    clone of SQL 'alter system set db_unique_name =

    "OlderDB" comment =

    ' Modified by RMAN duplicate "scope = spfile;

    clone to stop immediately;

    Start clone force nomount

    Restore controlfile primary clone of ' / home/oracle/OlderDB/controlfile_ProdDB_20141001_4159.bkp';

    change the clone database mount;

    }

    execution of Script memory

    SQL statement: alter system set control_files = comment "+DATA/OlderDB/controlfile/current.829.859839217" = "defined by RMAN" scope = spfile

    SQL statement: change the system db_name set = comment "ProdDB" = "modified by RMAN duplicate" scope = spfile

    SQL statement: alter system set db_unique_name = comment "OlderDB" = "modified by RMAN duplicate" scope = spfile

    (...)

    From restoration to 1 October 14

    allocated channel: ORA_AUX_DISK_1

    channel ORA_AUX_DISK_1: SID = 191 type device = DISK

    channel ORA_AUX_DISK_1: restore the control file

    channel ORA_AUX_DISK_1: restoration complete, duration: 00:00:03

    output file name=+DATA/OlderDB/controlfile/current.829.859839217

    Restoration finished in October 1, 14

    mounted database

    output channel: ORA_AUX_DISK_1

    allocated channel: ORA_AUX_DISK_1

    channel ORA_AUX_DISK_1: SID = 191 type device = DISK

    content of Script memory:

    {

    until the SNA 274262921.

    the value of newname for datafile clone 1 again;

    the value of newname for datafile clone 2 again.

    the value of newname for datafile clone 3 again.

    the value of newname for datafile clone 4 new ones;

    the value of newname for datafile clone 5 again.

    the value of newname for datafile clone 6 again.

    the value of newname for datafile clone 7 again.

    restoration

    database clone;

    }

    (...)

    From restoration to 1 October 14

    using the ORA_AUX_DISK_1 channel

    channel ORA_AUX_DISK_1: from the restore backup set data file

    channel ORA_AUX_DISK_1: specifying datafile (s) to restore from backup set

    channel ORA_AUX_DISK_1: restore datafile 00001 to + DATA

    channel ORA_AUX_DISK_1: restore datafile 00002 to + DATA

    channel ORA_AUX_DISK_1: restore datafile 00003 to + DATA

    channel ORA_AUX_DISK_1: restore datafile 00004 in + DATA

    channel ORA_AUX_DISK_1: restore datafile 00005 to + DATA

    channel ORA_AUX_DISK_1: restore datafile 00006 to + DATA

    channel ORA_AUX_DISK_1: restore datafile 00007 to + DATA

    channel ORA_AUX_DISK_1: reading from the backup /home/oracle/OlderDB/database_ProdDB_20141001_4157.bkp piece

    channel ORA_AUX_DISK_1: ORA-19870: error when restoring the backup /home/oracle/OlderDB/database_ProdDB_20141001_4157.bkp piece

    ORA-19504: cannot create the file '+ DATA '.

    ORA-17502: ksfdcre:4 cannot create the file + DATA

    ORA-15041: diskgroup space 'DATA' exhausted

    switch to the previous backup

    Oracle instance started

    (...)

    content of Script memory:

    {

    clone of SQL 'alter system set = db_name

    "OlderDB" comment =

    ' Restore the original value by RMAN "scope = spfile;

    clone of SQL 'alter system reset db_unique_name scope = spfile;

    clone to stop immediately;

    }

    execution of Script memory

    Errors in the script of the memory

    RMAN-03015: an error has occurred in the script stored memory Script

    RMAN-06136: the auxiliary database ORACLE error: ORA-01507: database not mounted

    ORA-06512: at "SYS." "X$ DBMS_RCVMAN ', line 13466

    ORA-06512: at line 1

    RMAN-05556: not all data files have backups can be recovered on SNA 274262921

    RMAN-03015: an error has occurred in the script stored memory Script

    RMAN-06026: some targets not found - abandonment of restoration

    RMAN-06023: no backup or copy of the file 4 found to restore

    RMAN-06023: no backup or copy of datafile 3 found to restore

    RMAN-06023: no backup or copy of datafile 2 found to restore

    RMAN-06023: no backup or copy of datafile 1 found to restore

    RMAN-00571: ===========================================================

    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.

    RMAN-00571: ===========================================================

    RMAN-03002: failure of the command duplicate Db at 15:39:11 01/10/2014

    RMAN-05501: abandonment of duplicate target database

    Complete recovery manager.

    ------------------------------------------------------------------

    The first mistake of the stack was ORA-19504 while trying to restore the backup of the database.

    First thing I took a glance was ASM occupation but it enough available space.

    The second was a permission problem, but it doesn't seem to be the case because RMAN can correctly write the controlfile to ASM.

    One have some advice on what I should look for?

    Thanks in advance sorry for my English.

    Select this option.

    Hello.

    Thanks, but is not the case. As I have said, that the DATA diskgroup has space enough he uses only a single disk in a RAID.

    But I solved my problem... To the auxiliary database, I added the following to the spfile:

    DB_FILE_NAME_CONVERT = '+ DATA/ProdDB', '+ DATA/OlderDB ".

    LOG_FILE_NAME_CONVERT = '+ DATA/ProdDB', '+ DATA/OlderDB ".

    I don't know why, but with these two clauses, it worked well. Perhaps RMAN was trying to restore it to the wrong place?

  • How to pass values to a variable of the file.

    Hello

    I want to pass values in a variable to a file. For example: I want to divide the records in the source based on the region and load a region at any given time. Is there a way I can tell ODI to load only one region at a time. Currently I think I have a varibale defined, pass the value from a file and use this variable in the source filter.

    All answers are appreciated.

    Thank you
    CHikk

    Hello

    Right thinking...

    Simply use the following command, to the updating of the ODI variable tab, to get the values directly in the file:

    Select REGION_NAME
    table
    / * $$ SNPS_START_KEYSNP$ CRDWG_TABLESNP$ CRTABLE_NAME = REGIONSNP$ CRLOAD_FILE = <%=odiRef.getSchemaName("D")%> \MY_FILE. TXTSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=09SNP$CRFILE_SEP_LINE=0D0ASNP$CRFILE_FIRST_ROW=0SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=REGION_NAMESNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLINE_OFFSET=1SNP$CRLENGTH=500SNP$CRPRECISION=500SNP$CR$$SNPS_END_KEY*/

    (the command between ' / * ' and ' * / ' must be in a single line)

    Change the 'MyFile' the real file name

    This help you?

  • Write database Variables in the file

    Hello

    I try to write data values to a file.

    Assuming that I put
    getDatabank("205Comp").getNextDatabankRecord ();

    and there is a column field in the file called Agt_ID

    I thought I'd be able to write
    utilities.getFileService () .appendStringToFile (fileLocation + file name, "Agent:" + "{{db.205Comp.Agt_ID}}" + "things more" + "\n");
    to add value.

    However, this puts the line
    Agent: {db.205Comp.Agt_ID} more things
    in the file instead of the data.

    The following statement works very well, so I expect this work.
    Info ("Agent:" + "{{db.205Comp.Agt_ID}}");

    How can I write the value of data in the file?

    Thank you very much
    Neil

    Neil

    I know the code you wrote for work, but if not you can try this instead:

    utilities.getFileService () .appendStringToFile (fileLocation + file name, "Agent:" + eval ("{{db.205Comp.Agt_ID}}") + "things more" + "\n");

    Concerning

    Alex

  • How to insert text in the middle of the file data model text in specific places?

    Hi all

    I need to add (text) data to specific model of existing text file locations and then rename the newly written file.

    This is a more compact and more efficient way to do it. You can optionally replace the recursive section of path with the file entry list VI. (the file IO - palette of functions of advanced files, take a look at the help file, you can search for a model in the name of the file and returns an array of the file found paths).

    Ben64

  • How to access the file data of QML

    Hi all

    I save my data foler xml file after I have download from Server compnay.

    So I hope that I can access data foler to load the XML to display the list.

    Does anyone know how to set up the data source of the qml?

    {To ListView

    objectName: "objVehicleListView."

    dataModel: {XmlDataModel}

    Source: "file://data/vehicles.xml".<--  how="" to="" point="" to="" data="">

    }

    listItemComponents:]

    {ListItemComponent}

    type: "vehicle".

    {StandardListItem}

    Title:ListItemData.unitName

    Description: ListItemData.licencePlate

    status: ListItemData.vehicleOwnerName

    }

    }

    ]

    }

    I think that it is not possible to get the path using QML pure code. By using the code BBSJdev, you can get the path in C++ and export it to QML.

    Add the following code after the qml loading, but before creating rootObject:

    QDeclarativePropertyMap *filenames = new QDeclarativePropertyMap;
    filenames->insert("vehicles", QVariant(QString(
            QDir::homePath() + "/vehicles.xml")));
    qml->setContextProperty("filenames", filenames);
    

    Then you can use QML:

    ListView {
      dataModel: XmlDataModel {
        source: filenames.vehicles
    
  • Issue, while reading the file data from a JMS queue

    Hello

    I'm trying a simple case to receive the XML of the JMS queue and inside BPEL use Assign activity to read data in a temporary variable to check the file from the JMS queue. I do the archive file name, CHRAPcXMLInvoices_DUNS_XXXXXXX_datestamp.dat, XXXXXX as the mapping of the identity of the XML from the JMS queue. Some reasons is not mapping... Can someone help me on this please? I stuck here because my final requirement was to insert the data from the XML file in a custom table, but because of this, it fails saying "can not insert a null" which means that some how he does not read the data...

    I enclose the screen... Please help...

    Hello

    I would try to replicate the same at my end, but you can do the following to me.

    You could manually put the message ("but add xmlns ="http://www.example.org" in cXML item payloadID") in the JMS and test it.

    For Ex:

    " xmlns ="http://www.example.org">"

    The XML message is clearly the namespace XSD lacks. The BPEL is looking in the correct namespace (xmlns:ns3 ="http://www.example.org" ") of the XML message, but as space of names are not added to the incoming message sound throw an exception.

    So, try to add the namespace to the XML message and publish manually in the JMS queue to start the process.

  • Properties of the file - Date of the last recorded

    Hello.

    I'm having trouble understanding the properties of the file, as "Last record Date" (DLS) and "Date modified" (MD).

    I asked that the last of them, MD, has been changed whenever the content has changed. But Distribution lists must be updated also.

    However, I have a file which has the DLS on 2007 and MD 2014 and the 'last impression"also is 2014.

    How is that possible?

    What has changed the date the content of the file was really the last?

    I would be grateful if someone could help me understand this.

    Thank you,

    Nuno Roque

    Modification date is when the file got changed on that hard drive.  Even if you have never opened the file, just drag-and - drop it to drive flash (for an example) would last updated date change, because the file on this disk changed really.

    Properties such as "Date of last recorded" and "date printed" are stored in the file itself, such as metadata and are updated no not by disk or operating system, but by the design (such as Word) program.

  • moved the file data, but the space used is always the same.

    Hi due to some problems of space I took the offline tablespace, then move the file to a location different and introduced the online storage space after renaming. After all this, the space used for the file system is always the same. How can I get the space freed up?

    Hello

    I'd be willing to bet that a core oracle process holds the lock (e.g. dbwr). use lsof (open list) command on each one and you should get the info or perhaps fuser.

    Paul

  • How to manually activate the file Data Execution Prevention?

    When using the Microsoft Fix it Center it could not activate my data execution prevention. How to solve this?

    Hi dear Lowe,
     
    Here are some articles that you might find useful:
     
  • The file date is no longer updated

    I had to reinstall HS 55 on a new computer. But now when I edit an HTML file, HS accept these changes as usual. After clicking on 'Save', the list of files is updated, but the date "changed"remains unchanged." This does not happen with any other editor that I use, and I can't find an option for this (most likley would be a strange option anyway...).
    As a result, neither backup nor tool-version see a modification of file, which is very inappropriate.

    Thanks for any idea.

    WinXP Pro SP2

    The new version of ZA is - thank you very much. I thought that could be the culprit the ZA newly installed and uninstalled the program, but nothing has changed... I made a note on the/clean switch anyway.

    Martin

  • Extract the file to the path

    I'm working on a project which seeks to this folder a file is in before determining what function to perform.  Currently I use nomchemin var = decodeURI (app.activeDocument.path.name); to extract the immediate folder the file is located in, but in some cases, I need to retrieve the name of a folder of that one.  For example, currently gets 1\ C:\Texture Sets\LibraryLarge Format and returns the 'Large Format' folder to the path variable, because the file that I work with is located in this folder.  What I need is a way to check for 'Library 1' in the same way using the same file.  Thanks for any help!

    dgolberg

    You can use...

    var parentFolder = decodeURI(app.activeDocument.parent.parent.name);
    alert(parentFolder);
    
  • Link to the variable of the scan engine

    I have the attached labview, the settings on a variable diagram and shared block.  In my project I have a cRio who is using the analytical engine and signals some time RTD.  in my computer, I have a shared variable that I have an alias to the scan on the cRio engine variable.  I thought that this would then make the variable shared on myComputer would report to the same as the engine to scan on the cRio variable; However, this is not the case.  In the front, you can see I get 0 for the myComputer shared variable while getting the correct value of the variable of cRio scanning engine.

    Binds a variable to a variable of scan engine means that it will keep the same value?  I have to do something more?  I want to do it this way because I have a VI that find all the variables in the file SystemParameter.lvlib and did things with them.

    Hey GreenRiver

    If I understand correctly, you bind the network variable to the ProcessInRTD indicator. If you put this code in a while loop with a stop button, what happens? You can have a race condition here, where he reads the network variable and puts this indicator and then reads the temperature of the unit and who refers to the indicator of RTD.

    A suggestion I have is just wire the output of IO functionality in the network within a variable period of time loop. Then, on your host VI, read the network variable.

  • Passage of QML variable to the Web format

    So I have a QML file as follows

    Container {
        id: cont
        property variant numArray: ["1","2","3","4","5"]
    
        WebView {
            id: webView
            html: "" +
            "" +
                "
    
                onCreationCompleted: {
                    console.log(numArray[0])
            }
        }
    }
    

    and the pie.js has the following

    onload=function(){
        document.write(numArray[0])
    };
    

    In the QML, WebView signal, "onCreationCompleted" file, print the correct value.

    However, JS, numArray variable is not written in the page in the file.

    My code is not exactly the same, but the structure is the same. How can I do for passing the QML variable in the file JS inside the WebView?

    Thank you!

    Using the method in this tutorial should work: http://www.bbcascades.com/index.php/tutorial-list/52-passing-information-to-html-from-qml

Maybe you are looking for