Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

soccersquirt82

macrumors 6502
Original poster
Mar 11, 2008
296
0
I am trying to write the file path for a file. I've tried many different ways such as using slashes, colons, extensions, spaces, etc., but I can't get it to work. The path on my Finder shows
"Macintosh HD/Users/crawfordcrenshaw/Documents/starburst". The extension of the "starburst" document is "pages". How do I write this path in my code?
 

soccersquirt82

macrumors 6502
Original poster
Mar 11, 2008
296
0
AHHHH!! Thank you! It didn't work in Pages, but I made it a rtf file and it worked! Except. . . When I debug the program, the "word" is a continuous string that looks like this: "\rtf1\ansi\ansicpg1252\cocoart". It's supposed to only have words such as "strawberry," "lemon," "cherry," and "orange." When I did this on Windows, the exact same program worked perfectly, which leads me to believe the problem has to do with the app I'm using, TextEdit. Is there a different app I should use?
 

skinnybeans

macrumors newbie
Dec 6, 2007
17
0
AHHHH!! Thank you! It didn't work in Pages, but I made it a rtf file and it worked! Except. . . When I debug the program, the "word" is a continuous string that looks like this: "\rtf1\ansi\ansicpg1252\cocoart". It's supposed to only have words such as "strawberry," "lemon," "cherry," and "orange." When I did this on Windows, the exact same program worked perfectly, which leads me to believe the problem has to do with the app I'm using, TextEdit. Is there a different app I should use?

Textedit is fine to use, but you need to make sure you save the file as plain text, not rtf. rtf contains lots of extra markup.

Think of it like html. If you open a html file in a brower, all you see is the final result of the mark up (because it knows how to read the tags), if you open it in a text editor you see all the tags. If you open an rtf document as plain text, you will see extra stuff in there.

I use TextWrangler for editing text files, it is free and a bit more developer friendly that using textedit.
 

skinnybeans

macrumors newbie
Dec 6, 2007
17
0
Windows is changing to a root directory scheme and dropping the drive letter? :eek:

hehe yep this is a good point. To get around this problem you either need to use relative paths or set up a .properties file for your application that contains the absolute path to any directories that you need to access. Had this problem recently at work actually when i was trying to get our java app running on os x, required a bit of stuffing around actually but got there in the end!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.