Update Script Problem CS2 to CS3 ( Time/Date/Year Script NOT WORKING IN CS3?

The below script works in CS2 but not in CS3? WHY?
//DESCRIPTION: Use to insert date/time into document.
if (app.documents.length == 0) { exit() }
insertDTs(app.documents[0]);
function insertDTs(aDoc) {
var curPrefs = aDoc.characterStyles[0].extractLabel("dtprefs");
if (curPrefs == "") {
// Doc has no prefs; use saved prefs
curPrefs = getCurPrefs(File(getScriptPath().absoluteURI.replace(/Insert\.jsx/, "Prefs.txt")));
} // end if curPrefs
var prefParts = curPrefs.split("\n");
if (prefParts[2] != "[None]") {
insertIt(aDoc, prefParts[0], prefParts[2]);
if (prefParts[3] != "[None]") {
insertIt(aDoc, prefParts[1], prefParts[3]);
function insertIt(aDoc, formString, cStyleName) {
var formStrings= ["Day, Month, Year"]
var theFuncs = [dayMonthYear]
var charStyleStrings = aDoc.characterStyles.everyItem().name
if (indexOf(charStyleStrings, cStyleName) < 1) { return } // style not found or is No Style
var func = indexOf(formStrings, formString);
if (func < 0) { return } // requested form not recognized
var dateString = theFuncs[func](new Date());
app.findPreferences = app.changePreferences = null;
aDoc.search("", false, false, dateString, {appliedCharacterStyle:cStyleName});
} // end insertIt
function dayMonthYear(date) {
date.setDate(date.getDate()+1);
// returns dayName, monthName date, year
var myDateString = date.toLocaleDateString();
myParts = myDateString.split(" 0");
if (myParts.length != 1) {
myDateString = myParts[0] + " " +myParts[1];
return myDateString.slice(0,-5) + "," + myDateString.slice(-5);
function indexOf(array, find,offs) {
for( var i = offs == undefined ? 0 : offs; array.length > i; i++ ) {
if( array[i]==find ) {return i}
return -1;
function getScriptPath() {
// This function returns the path to the active script, even when running ESTK
try {
return app.activeScript;
} catch(e) {
return File(e.fileName);
} // end try
} // end getScriptPath
} // end insertDTs

It uses CS2-style searching is the most obvious problem.
Try putting it in a folder named "Version 4.0 Scripts" -- without the quotes -- and run it from there.
Dave

Similar Messages

  • I have iPhone 4 and I update it to iOS 7 and when I try to start the personal hotspot it crashed and for sometime my cellular data was also not working then allot a sudden the personal hotspot icon disappeared from my settings

    I have iPhone 4 and I update it to iOS 7 and when I try to start the personal hotspot it crashed and for sometime my cellular data was also not working then allot a sudden the personal hotspot icon disappeared from my settings.
    Has anyone faced a problem like this!!!

    No. If you go Settings App > General > Reset > "Erase All Content and Settings", you will have the same iOS that was on the iPhone when you tapped the Erase button. If you believe your iPhone is Jailbroken, then this will not work. If you use iTunes on computer, this will put iPhone to current iOS which is iOS 7.0.2

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

  • I have a problem with Adobe Creative Cluod. Basically after installing the application when I open it I do not charge adobe products but remains all white screen. I tried to uninstall it and install it several times but it does not work.  What should I do

    I have a problem with Adobe Creative Cluod. Basically after installing the application when I open it I do not charge adobe products but remains all white screen. I tried to uninstall it and install it several times but it does not work.
    What should I do?

    Hi Anto2211,
    Please follow the thread: Black screen CC where this issue is already discussed and resolved.
    Let me know for any further query.
    Thanks,
    Ratandeep Arora

  • Updated to 10.4 and the New Purchased feature is not working. Anyone else having this problem?

    Updated to 10.4 and the New Purchased feature is not working. Anyone else having this problem?

    I did originally, but it fixed itself after a few minutes.

  • Hello, my itunes app is getting shut down every time I want to open it. Ever since I downloaded the last two updates. I tryed repearing the file and uninstalling and installing several times. Still, is not working. I work with music and need my itunes

    Hello, my itunes app is getting shut down every time I want to open it.
    I don't know if it's related but ever since I downloaded the last two updates. I tryed reparing the file and uninstalling and installing several times. Still, is not working. I work with music and need my itunes up and running. Does anybody know how to fix this?

    Hi Vero Torres,
    If you are having issues with iTunes unexpectedly quitting on launch after on your Windows machine, you may find the troubleshooting steps outlined in the following article helpful:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Regards,
    - Brenden

  • I updated my iPhone 4S to the new IOS 6 I like it but the problem I found the Wifi button it's not working any more it looks hidden , so what I should do to solve this issue ASAP

    I updated my iPhone 4S to the new IOS 6 I like it but the problem I found the Wifi button it's not working any more it looks hidden , so what I should do to solve this issue ASAP

    Tap Settings App > General > Reset > Reset Network Settings. See if fixed. If not, Restore Firmware with iTunes on computer. See if fixed. If not, all iPhone 4S have Warranty, make Genius reservation and take iPhone to Apple for resolution.

  • Hello i was updating my ipod 5 to ios 8 and when it was in the middle of updating it came up that i had to connect to itunes and i have done so and its telling me to restore it and i have tried many time to and its not working. So what to i do??

    hello i was updating my ipod 5 to ios 8 and when it was in the middle of updating it came up that i had to connect to itunes and i have done so and its telling me to restore it and i have tried many time to and its not working. So what to i do??

    What exactly happens when you try to restore via iTunes?
    Error messages?

  • Droid Razr Maxx HD Data & SMS does NOT work in South Korea

    If you are going to South Korea this phone only operates as a "dumb phone" for phone calls ONLY. Data & SMS does not work at all. I contacted Global Support daily for one week with no resolution! I received conflicting information with 2 support folks telling me that the fix was to do a factory reset. So I reluctantly did this and it did not fix anything. It only wasted my time especially re-installing all my apps, etc. Then 4 support folks told me that you should never do this out of the country!! Anyway the last person i spoke to which was a network technician was very honest. He told me that I was "SOL" and he had no idea how to fix this problem. He said that he would have to get some teams together to try to fix the problem. And I was told that I would receive an email with an update. And of course I have not received any email of correspondence from Verizon. Very frustrating...

    I found a solution. Okay so with the most recent update Verizon made the switch from sending text messages over their 1x network and moved them to their LTE (and possibly 3g) network, hence the reason they are sending so much faster. Today I was in a classroom that is underground and has terrible reception and noticed that I was getting delivery reports again but that my texts were sending slower, like they used to. I dug around in the phones programing menu and found a new option call "MO SMS over IMS" and it was enabled. Disabling it switches your texts back onto the old 1x network. So if you choose to make the switch, your delivery reports will come back but sending will go back to being a little slower. To get to this menu open up your dialer and type in ##7764726. Next hit send and when prompted with a password type in 000000 and hit verify. Scroll down to SMS/MMS settings and select it. Next scroll to the bottom, select "MO SMS over IMS", and disable it. Now your good delivery reports back!

  • N95 8Gb USB Data Transfer Mode not working

    I have a bizarre problem with USB Data transfer.
    a) I upgraded to the new 15.x firmware with the correct HKCSL package - 0557980
    b) I connected PC #1 in data transfer mode with no issue and copied a bunch of installers onto the mass memory and went on to install them - to the PHONE memory.
    c) Later in the day, connected PC #2 and did the same with the last few applications.
    d) Next day tried to connect PC #1 and it didn't work
    e) Thought I must have an application using the MASS storage but checked and not so - all apps on Phone memory.
    f) Went to PC #2 and tried - Data transfer mode works - no problem.
    g) Tried PC #1 again, and still not working. I get all the right messages (Mass storage cannot be used at this time etc) on the handset, and I get the "safely remove hardware" option appearing on the PC - but I don't get a drive letter assigned in the Windows Explorer.
    h) I have tried it on PC #3 and this works as well - no problem.
    1. The working PC's both have PC Suite 2-Beta installed, while the problem PC has no PC suite at all.
    2. I have downloaded the Nokia-connectivity_cable_driver_rel_6_85_10_0 and it installs properly - giving all the expected wireless... options in Device Manager, but I still don't get a drive letter assigned with the basic data transfer mode on this problem PC #1
    So the issue seems to be with a PC that has never seen any version of PC suite, but it worked straight after the firmware upgrade.
    All PC's are XP SP2.
    Any suggestions on anything else to try ?
    Regards

    SOLVED by:
    - attaching N95, selecting USB Data Transfer Mode
    - Going to Device Manager
    - Selecting the USB Mass Storage Device for N95
    - "Uninstall"
    - Remove cable when N95 says its safe to
    - Re-attach cable
    The PC then re-discovered and reloaded the drivers including the mass storage which then worked normally.
    No idea what messed it up in the first place though.

  • Pie chart with two measures and date dimension navigation not working

    Hi Experts,
    Pie chart with two measures and date dimension navigation not working. Any help is appreciated.
    Thanks
    V

    Hi Deepak,
    I had time dimension in the RPD.
    I have stacked bar chart with same time dim like year & month in the report. when I go to legand and set navigation it is working fine. But not with pie chart.
    I am not not sure what is the problem. When I click on Pie chart it is not navigating to the target report. Can it be any other issues..???

  • I backed up my Iphone to itunes so i can do the new Update to IOs 7 and so now that i updated it i want to backup and restore and its not working, Please help!

    I backed up my Iphone to itunes so i can do the new Update to IOs 7 and so now that i updated it i want to backup and restore and its not working, Please help!

    An iPhone backup to a computer via iTunes stores the photos in a backup file that is only meant to be be used if needed to restore back to the phone. There is 3rd party "extractor" software available but otherwise the photos are not directly viewable.
    The backup via iTunes was a good idea and your Camera Roll photos should be there and should be able to be restored to your new phone. However if it was me I wouldn't rely on that alone. I would also import the photos to a computer where you can see and verify that you have a copy. That is a good idea at any time (not just when you know you might need it). Any phone can be lost, broken, suffer hardware issues, etc at any time and lose all data on it. Following is a link with information on how to import the photos to a computer:  Import photos and videos from your iPhone, iPad, or iPod touch to your Mac or Windows PC - Apple Support

  • Oracle date parameter query not working?

    http://stackoverflow.com/questions/14539489/oracle-date-parameter-query-not-working
    Trying to run the below query, but always fails even though the parameter values matches. I'm thinking there is a precision issue for :xRowVersion_prev parameter. I want too keep as much precision as possible.
    Delete
    from CONCURRENCYTESTITEMS
    where ITEMID = :xItemId
    and ROWVERSION = :xRowVersion_prev
    The Oracle Rowversion is a TimestampLTZ and so is the oracle parameter type.
    The same code & query works in Sql Server, but not Oracle.
    Public Function CreateConnection() As IDbConnection
    Dim sl As New SettingsLoader
    Dim cs As String = sl.ObtainConnectionString
    Dim cn As OracleConnection = New OracleConnection(cs)
    cn.Open()
    Return cn
    End Function
    Public Function CreateCommand(connection As IDbConnection) As IDbCommand
    Dim cmd As OracleCommand = DirectCast(connection.CreateCommand, OracleCommand)
    cmd.BindByName = True
    Return cmd
    End Function
    <TestMethod()>
    <TestCategory("Oracle")> _
    Public Sub Test_POC_Delete()
    Dim connection As IDbConnection = CreateConnection()
    Dim rowver As DateTime = DateTime.Now
    Dim id As Decimal
    Using cmd As IDbCommand = CreateCommand(connection)
    cmd.CommandText = "insert into CONCURRENCYTESTITEMS values(SEQ_CONCURRENCYTESTITEMS.nextval,'bla bla bla',:xRowVersion) returning ITEMID into :myOutputParameter"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.ReturnValue
    p.DbType = DbType.Decimal
    p.ParameterName = "myOutputParameter"
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion"
    v.Value = rowver
    cmd.Parameters.Add(v)
    cmd.ExecuteNonQuery()
    id = CType(p.Value, Decimal)
    End Using
    Using cmd As IDbCommand = m_DBTypesFactory.CreateCommand(connection)
    cmd.CommandText = " Delete from CONCURRENCYTESTITEMS where ITEMID = :xItemId and ROWVERSION = :xRowVersion_prev"
    Dim p As OracleParameter = New OracleParameter
    p.Direction = ParameterDirection.Input
    p.DbType = DbType.Decimal
    p.ParameterName = "xItemId"
    p.Value = id
    cmd.Parameters.Add(p)
    Dim v As OracleParameter = New OracleParameter
    v.Direction = ParameterDirection.Input
    v.OracleDbType = OracleDbType.TimeStampLTZ
    v.ParameterName = "xRowVersion_prev"
    v.Value = rowver
    v.Precision = 6 '????
    cmd.Parameters.Add(v)
    Dim cnt As Integer = cmd.ExecuteNonQuery()
    If cnt = 0 Then Assert.Fail() 'should delete
    End Using
    connection.Close()
    End Sub
    Schema:
    -- ****** Object: Table SYSTEM.CONCURRENCYTESTITEMS Script Date: 1/26/2013 11:56:50 AM ******
    CREATE TABLE "CONCURRENCYTESTITEMS" (
    "ITEMID" NUMBER(19,0) NOT NULL,
    "NOTES" NCHAR(200) NOT NULL,
    "ROWVERSION" TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL)
    STORAGE (
    NEXT 1048576 )
    Sequence:
    -- ****** Object: Sequence SYSTEM.SEQ_CONCURRENCYTESTITEMS Script Date: 1/26/2013 12:12:48 PM ******
    CREATE SEQUENCE "SEQ_CONCURRENCYTESTITEMS"
    START WITH 1
    CACHE 20
    MAXVALUE 9999999999999999999999999999

    still not comming...
    i have one table each entry is having only one fromdata and one todate only
    i am running below in sql it is showing two rows. ok.
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  '830' and  '850'  and t1.U_frmdate ='20160801'  and  t1.u_todate='20160830'
    in commond promt
      select t1.U_frmdate,t1.U_todate  ,ISNULL(t2.firstName,'')+ ',' +ISNULL(t2.middleName ,'')+','+ISNULL(t2.lastName,'') AS NAME, T2.empID  AS EMPID, T2.U_emp AS Empticket,t2.U_PFAcc,t0.U_pf 
       from  [@PR_PRCSAL1] t0 inner join [@PR_OPRCSAL] t1
       on t0.DocEntry = t1.DocEntry
       inner join ohem t2
       on t2.empID = t0.U_empid  where  t0.U_empid between  {?FromEmid} and  {?ToEmid} and t1.U_frmdate ={?FDate} and  t1.u_todate={?TDate}
    still not showing any results..

  • Use member on data form does not work

    Hello,
    "Use member on data" option does not work on composite Data Form. Business rule associated with composite form.
    Who is resolve this problem?
    Version hyperion: 11.1.2
    Thanks

    I don't have a solution for you but more steps to solve the problem
    You are ultimately on the right track in some ways but break it down into it's components.
    The problem could like in the business rule, the form connection, the variables, even the order of operations could all be in play.
    So I would strip this baby down to its bare bones then build it back up.
    1) Run the business rule. Each one separately and only after the previous ones is complete without variables and without touching the form
    Is it successful: go to 2
    If it isn't successful: trouble shoot the calc and or try running in EAS natively to see if that gives you ideas
    2) Run the calc outside the form but with variables included. Did it prompt you correctly.
    Is it successful: go to 3
    If it isn't. What is wrong with the variable
    3) Now attach it to the form but don't hide the prompts
    Still good go to 4
    4) hide the prompts and run on save
    And if it fails on step four then it's not picking up the right variables in the prompt. And you need to look at why it wouldn't grab the right item.
    This will isolate your problem for you and give you steps to fix it. Ultimately 99% of the time something did change in the structure for example that is impacting the calc. And when you isolate the problem this will reveal itself quite quickly.

  • Time capsule now does not work with Lion just installed.

    Just downloaded Lion to Mac Air. Time capsule now does not work. Where is the problem?

    Restart the TC.. lion is stupid.. it forgets what it is connected to with alarming frequency ... like someone suffering dementia.
    If it continues to have issues, plug the TC directly to the lion computer by ethernet (if not already) and try again. Change the wireless to manual in airport utility and change the wireless name.. to force a new configuration. Once setup you can just use wireless.
    In the end you may need to reset the TC.. just hold in the reset button for about 10sec. It should then become available.. a reset does not do anything to data on the hard drive but you might need to restore any passwords.

  • TS3694 I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I have no idea what may have caused your MacBook to stop working, but from your description it kind of sounds like it may have started before you ran Software Update and installed the new Apps. Just the general slow feeling and bugginess is what tips me off. You said that you weren't sure if you had closed all open windows, that doesn't matter if the computer restarts itself. It automatically closes all other open applications when restarting.
    As to your data being retrievable, if when you take it in they do a fresh install of the OS, then no, it will not be unless you want to pay several thousand dollars to a software retrieval company.
    I am glad to hear that you have taken into the Apple Store to get it fixed, and that you have all of your purchased music backed up to your iPod. You should be able to just transfer it all back to iTunes once you get your computer back should it be necessary.
    As a side note, the proper place for this topic would probably in the MacBook forums, not iTunes since there is no evidence that iTunes started the issue.

Maybe you are looking for

  • Aperture 2.1.4 crashing

    To make a long story short, this is a brief of my ordeal, with conclusions at the end. a) Aperture 2.1.3 (+40.000 images library) + OS 10.5.8 Initial configuration a couple months ago. Running smoothly. Until I decided to upgrade the OS... b) Apertur

  • ABAP program is not working

    I am using ABAP stage in Datastge job and new requirement is only add a new column where the column length is 25. Previously the program was below    IF d_len < 16000.       d_pack+d_offset(77) = it_1.       d_offset = d_offset + 77.       d_len = d_

  • Photos are dark when exported from LR

    I don't know if this has come up before, didn't find it in search. When I work up a photo in LR I get it where I want. I then export to another folder. When I view that photo in any other program it is very dark, though importing and viewing in LR it

  • How to increase the width of field Whld Tax

    Dear Friend, I was configuring WHT formulae for TDS setcion code 195 with Time dependant formulae My requirement is If the base amount is 100000 the TDS will be as under:- TDS  @ 10%              =  Rs10000/- Surcharge @2.5%    =   Rs.250/-     (2.5%

  • Lost my iPhone in a taxi in Washington DC today

    How do I track where my phone is in Washington DC?  I have called the number, texted, and finally asked Verizon to shut it off.