Ok, with panther, how can I make it so that it writes data to the file in the same folder without the user having to manually input the root. Also, how do I make it so that if the file doesn't exist, it creates it again?
Thanks!
Offline
Servine wrote:
Ok, with panther, how can I make it so that it writes data to the file in the same folder without the user having to manually input the root. Also, how do I make it so that if the file doesn't exist, it creates it again?
Thanks!
use a user path block 
(you need to hit create a block button)
ripped off a random panther project (scratchchat 1.2 or somthing o_O)
name: user path type of block: reporter (just put r in the box that has the - in it) code: ^ ScratchPlugin primGetFolderPath: 1
have fun
Last edited by flashgocrazy (2011-11-28 16:10:33)
Offline
If you don't put a path, just a file name e.g. file.txt it will automatically assume the file is in the same folder as the panther1.0.image file. That means it will then place the file there no matter where the image file actually is and this solves a lot of problems.
If you really want to know the root of the image file, opening up the containing folders to you, you can create a custom block that reports the root. It's in the library here.
Then you can do this: [write [] to file [(join(path to image) [file.txt])]
take a look through the library, there are a lot of useful Panther blocks there that you may find useful! The Scratch blocks can be converted most of the time in a few seconds to work with Panther too!
Offline