First of all, let me thank you in advance for the huge content that is this forum, It's really nice and helped me a lot in creating some simple scripts that evolved my workflow to another level. I don't have lots of programming skills, but I'm good at putting some things together, and this is where I got on this new script that I'm working:

Basically what I'm trying to do is to save the file on a different path based on the path that he is saved now. So I'm using the slice to get the portion of the file path that contains the info that I need to choose the destination folder, create it and then save the file.

But I'm getting an error on line 8, on the slice thing:

Error 24: doc.path.slice is not a function.

Line: 8

-> var OS = doc.path.slice(-5, -1);

I tested the slice logic in other cases online, and seems to work just fine, but PS is'nt accepting it. What am I doing wrong? Can you guys help me out?

Ah, and I manually inserted the "OS" and "tipo" variables, without slicing them from the file path and It work's just fine.

Hey Kukurykus! Thanks for your answer man! I was searching the web about this problem and found a post on PS-Scripts that solved my problem. I added the "fullName" thing before the slice and now it's fully functional: