AE ENHANCERS

Expressions/Scripts/Presets
It is currently Fri May 24, 2013 3:49 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: split does not work here
PostPosted: Wed Mar 31, 2010 5:03 am 
Offline

Joined: Fri Jan 30, 2009 4:11 pm
Posts: 10
hi folks,
im trying to split a footage path into an array on windows. but with no luck:

Code:
var selItems = app.project.selection;
if (selItems.length > 0){
   for (i=0; i < selItems.length; i++){
      var footagePath=selItems[i].file;
      alert (footagePath);
      var splitFootagePath = footagePath.split("/");
      alert (splitFootagePath);
   }
} else {
      alert("Error");
}


this line:

Code:
var splitFootagePath = footagePath.split("/");


causes this error:

Quote:
Unable to execute script at line 6. Function footage.split is undefined


any help?

thanks in advance,
payton


Top
 Profile  
 
 Post subject: Re: split does not work here
PostPosted: Wed Mar 31, 2010 7:58 am 
Offline

Joined: Sat Jun 26, 2004 10:01 am
Posts: 298
Location: Folsom, CA
I think your footagePath is actually a file object. Try this:

var footagePath=selItems[i].file.path;


Dan

_________________
http://www.motionscript.com


Top
 Profile  
 
 Post subject: Re: split does not work here
PostPosted: Wed Mar 31, 2010 8:26 am 
Offline

Joined: Fri Jan 30, 2009 4:11 pm
Posts: 10
hi dan,
that works!
thanks for this.

i found another solution that works, but dont know why:

Code:
var footageLocString=footageLoc.toString();


why this wasn't a string before, and what is the difference between the path and file (except the filename)?

anyway, it works!

cheers,
payton


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group