> $.twFile.copy(/Users/billa/Dropbox/backup/, /Users/billa/Desktop/
> Test-Backup.rwsw);
> Getting SyntaxError: Unexpected token ',' What am I doing wrong?
In JS, text enclosed within /.../ is interpreted as a literal regular
expression (text pattern). Thus, when the JS engine starts parsing "/
Users/billa/Dropbox/backup/", it sees valid JS syntax, but then
encounters a comma (which is not a valid token at that point in the
regular expression), resulting in the syntax error you are seeing.
To ensure that the JS engine parses the arguments properly (i.e,
twFile(...) is correctly passed two comma-separated text strings
rather than a encountering a badly formed regular expression), you
need to enclose each path/file within double quotes, like this:
$.twFile.copy("/Users/billa/Dropbox/backup/", "/Users/billa/Desktop/
Test-Backup.rwsw");
That should do it.
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
WAS THIS ANSWER HELPFUL? IF SO, PLEASE MAKE A DONATION
http://www.TiddlyTools.com/#Donations
Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
http://www.TiddlyTools.com/#Contact
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywikidev?hl=en.