Javascript Date object returns wrong date

Apr 7, 2007 at 12:01am

Javascript Date object returns wrong date

Hi,

I am having a problem with the javascript date object, which is returning the wrong date. For instance, javascript returns:
Thu Apr 05 2007 16:22:51 GMT+1344 (PDT)

Whereas the max date object (correctly) returns:
Apr 6, 2007 16:22:51

// date test
function bang(){
var testdate = new Date();
post (testdate.toString(), “n”);
}

Methods toLocaleString, getUTCDate, etc., all return the wrong date.

Any thoughts?

Thanks,
Ben
(4.6.2, 10.4.8, Intel Macbook)

#31238
Apr 20, 2007 at 10:08pm

Hi c74,

Do you reproduce this issue?

Thank you.

#101184
Apr 26, 2007 at 11:46am

Hi All

I am using javascript as a main tool to generate my MAX/MSP patches. Can anybody please tell me how to delete a file by using MAX/MSP? Is there any methods associated with javascript or any of the objects in MAX? I am using MAC environment.

Many thanks in advance.

Sunish George

#101185
Apr 26, 2007 at 2:07pm

Run the shell command ‘rm’ through the ‘shell’ external, available from:

http://www.cycling74.com/twiki/bin/view/Share/JeremyBernstein

If it’s a quicktime file, it can be deleted by sending the message “kill” to a jit.qt.movie object into which the file has been loaded.

ben

#101186
Apr 27, 2007 at 10:44am

Hi ben

Thank you for your email. I copied the shell.mxo file to ‘external’ folder and modfied max-objectmappings.txt and max-objectlist.txt (in ‘init’ folder) as mentioned in the MAX documentation.

I added the following lines to the aforementioned files respectively.

max objectfile !/ shell;
max oblist System shell;

Now, when I run MAX/MSP, I am getting ‘shell’ from the object list, but the object created is not having any input or output. Do I need to do anything other modification other than those mentioned above to get it right? Or, is there anything wrong with the modification that I did? Hope you can help me.

Thanks and regards,

Sunish

NB: I am trying to delete some ‘.txt’ files that I created at the end of the program.
—–Original Message—–
From: javascript-dev-bounces@cycling74.com on behalf of _ben
Sent: Thu 4/26/2007 15:07
Subject: [javascript-dev] Re: How do I delete a file using MAX/MSP?

Run the shell command ‘rm’ through the ‘shell’ external, available from:

http://www.cycling74.com/twiki/bin/view/Share/JeremyBernstein

If it’s a quicktime file, it can be deleted by sending the message “kill” to a jit.qt.movie object into which the file has been loaded.

ben

#101187
May 4, 2007 at 12:35pm

If you’re having problems with shell (I never messed with the
objectmappings file, just stuck the object in the searchpath, & it
works fine) you can also do it with an mxj — here’s the code for
[mxj killer]:

import com.cycling74.max.*;

public class killer extends MaxObject {

public killer() {
declareInlets(new int [] {DataTypes.MESSAGE});
declareOutlets(NO_OUTLETS);
}

public void delete (String fname);

public void anything (String s, Atom[] args) {
if (exists(s)) {
s.delete();
}
}
}

M

On Apr 27, 2007, at 6:44,
wrote:

> Hi ben
>
> Thank you for your email. I copied the shell.mxo file to ‘external’
> folder and modfied max-objectmappings.txt and max-objectlist.txt
> (in ‘init’ folder) as mentioned in the MAX documentation.
>
> I added the following lines to the aforementioned files respectively.
>
> max objectfile !/ shell;
> max oblist System shell;
>
> Now, when I run MAX/MSP, I am getting ‘shell’ from the object list,
> but the object created is not having any input or output. Do I need
> to do anything other modification other than those mentioned above
> to get it right? Or, is there anything wrong with the modification
> that I did? Hope you can help me.
>
> Thanks and regards,
>
> Sunish
>
> NB: I am trying to delete some ‘.txt’ files that I created at the
> end of the program.
> —–Original Message—–
> From: javascript-dev-bounces@cycling74.com on behalf of _ben
> Sent: Thu 4/26/2007 15:07
> Subject: [javascript-dev] Re: How do I delete a file using MAX/MSP?
>
>
> Run the shell command ‘rm’ through the ‘shell’ external, available
> from:
> http://www.cycling74.com/twiki/bin/view/Share/JeremyBernstein
>
> If it’s a quicktime file, it can be deleted by sending the message
> “kill” to a jit.qt.movie object into which the file has been loaded.
>
> ben
>

#101188

You must be logged in to reply to this topic.