put into URL not putting
Would someone be so kind and please analyze the following script to tell me why it will only write the data to the Preferences file just once, and every time afterward it will not write anything? on setPref prefName,prefData put prefData into preferencesData[prefName] put the keys of preferencesData into theKeys repeat with x=1 to the number of lines in theKeys put line x of theKeys = preferencesData[(line x of theKeys)] cr after newData end repeat put newData into url (file:Preferences.dat) end setPref Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Has the hard disk containing the file spun down at the time of the second 'put'? That's one thing that will prevent a write/put. If that's the case, you can force the HD to start spinning again by getting 'the files' or 'the detailed files'. Then you can write successfully. Insert the following code immediately after the 'put' line. It might yield a clue: get the result if it empty then answer it end if HTH - Phil Davis Derek Bump wrote: Would someone be so kind and please analyze the following script to tell me why it will only write the data to the Preferences file just once, and every time afterward it will not write anything? on setPref prefName,prefData put prefData into preferencesData[prefName] put the keys of preferencesData into theKeys repeat with x=1 to the number of lines in theKeys put line x of theKeys = preferencesData[(line x of theKeys)] cr after newData end repeat put newData into url (file:Preferences.dat) end setPref Derek Bump Dreamscape Software ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Phil Davis wrote: Has the hard disk containing the file spun down at the time of the second 'put'? That's one thing that will prevent a write/put. If that's the case, you can force the HD to start spinning again by getting 'the files' or 'the detailed files'. Then you can write successfully. I inserted a get the detailed files before the put command and it still didn't write the updated data. I also tried deleting the file first, but then the put command wouldn't even create a new file as opposed to the first time I run the script when it normally would. Insert the following code immediately after the 'put' line. It might yield a clue: get the result if it empty then answer it end if Each time the result was empty and nothing was written. I'm pulling my hair out trying to find a solution to this problem. I just don't understand why it would work the first time, then never again. But thanks Phil. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
One other thought... are the file's permissions set OK to allow rewrite? Or did something change since it was created? I know it's a long shot. Phil Derek Bump wrote: Phil Davis wrote: Has the hard disk containing the file spun down at the time of the second 'put'? That's one thing that will prevent a write/put. If that's the case, you can force the HD to start spinning again by getting 'the files' or 'the detailed files'. Then you can write successfully. I inserted a get the detailed files before the put command and it still didn't write the updated data. I also tried deleting the file first, but then the put command wouldn't even create a new file as opposed to the first time I run the script when it normally would. Insert the following code immediately after the 'put' line. It might yield a clue: get the result if it empty then answer it end if Each time the result was empty and nothing was written. I'm pulling my hair out trying to find a solution to this problem. I just don't understand why it would work the first time, then never again. But thanks Phil. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
On 5 May 2005, at 20:00, Derek Bump wrote: Would someone be so kind and please analyze the following script to tell me why it will only write the data to the Preferences file just once, and every time afterward it will not write anything? on setPref prefName,prefData put prefData into preferencesData[prefName] put the keys of preferencesData into theKeys repeat with x=1 to the number of lines in theKeys put line x of theKeys = preferencesData[(line x of theKeys)] cr after newData end repeat put newData into url (file:Preferences.dat) end setPref A couple of points. Is preferencesData declared as a global (or local) variable somewhere? (e.g. at the top of the script.) If not, the data won't persist and the array will only contain a single element (the one just added) when you get to the repeat loop? You should check the result after the Put ... into url line. This will tell you if an error occurred. Ex. put newData into url (file:Preferences.dat) if the result is not empty then answer the result end if Dave ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Phil Davis wrote: One other thought... are the file's permissions set OK to allow rewrite? Or did something change since it was created? I know it's a long shot. I would have no idea on how to even set a file's permissions on Windows XP. If you can shed some light, otherwise I'm clueless. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Dave Cragg wrote: Is preferencesData declared as a global (or local) variable somewhere? (e.g. at the top of the script.) If not, the data won't persist and the array will only contain a single element (the one just added) when you get to the repeat loop? It's a global that's declared at the beginning of my common library. My intention is to use my common library for preferences so I can get away from the Registry and ease the port to MacOS X. You should check the result after the Put ... into url line. This will tell you if an error occurred. Yeah, the result just returns empty. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
You can at least find out what the file permissions are this way: on mouseUp -- as in a button answer folder Pick the folder containing your file: if it = empty then exit mouseUp set the defaultFolder to it put the detailed files into tFileList filter tFileList with *Preferences.dat* -- leaves a single line answer item 10 of tFileList -- the file permissions item end mouseUp Permissions here can be understood same as on other systems. Phil Derek Bump wrote: Phil Davis wrote: One other thought... are the file's permissions set OK to allow rewrite? Or did something change since it was created? I know it's a long shot. I would have no idea on how to even set a file's permissions on Windows XP. If you can shed some light, otherwise I'm clueless. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Phil Davis wrote: You can at least find out what the file permissions are this way: on mouseUp -- as in a button answer folder Pick the folder containing your file: if it = empty then exit mouseUp set the defaultFolder to it put the detailed files into tFileList filter tFileList with *Preferences.dat* -- leaves a single line answer item 10 of tFileList -- the file permissions item end mouseUp Permissions here can be understood same as on other systems. Phil The result of the above script: 666 As I remember from my days of perl scripting, 666 for a file pretty much means that anyone can read/write the file. So with that in mind, how does anyone else write their preferences on a Mac? I'd rather just put the prefs in a custom property, but there's no way to save the data within the standalone other than write it to an external file. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Derek Bump wrote: Phil Davis wrote: You can at least find out what the file permissions are this way: on mouseUp -- as in a button answer folder Pick the folder containing your file: if it = empty then exit mouseUp set the defaultFolder to it put the detailed files into tFileList filter tFileList with *Preferences.dat* -- leaves a single line answer item 10 of tFileList -- the file permissions item end mouseUp Permissions here can be understood same as on other systems. Phil The result of the above script: 666 As I remember from my days of perl scripting, 666 for a file pretty much means that anyone can read/write the file. 666 indicates Satanic influence. If you rebuke it in the name of the diety of your choice the problem should go away. So with that in mind, how does anyone else write their preferences on a Mac? I'd rather just put the prefs in a custom property, but there's no way to save the data within the standalone other than write it to an external file. You can put the prefs into a custom prop of a separate stack and save that to the Prefs folder on Mac or the Application Data folder on Win: if the platform is MacOS then get specialFolderPath(Preferences) else get specialFolderPath(28) end if put /fourthworld.com/myPRefs.prf after it create stack MyPrefsStack set the filename of stack MyPrefsStack to it save stack MyPrefsStack Where does the 28 come from? In addition to the strings accepted by Rev for specific folders in the specialFolderPath function, both Mac OS and Windows use constants to define others. Ken Ray has generously taken the time to list them all, but alas until he finishes de-framing his site I can't send you the URL to the specific page, only to the page the tips are listed on: http://www.sonsothunder.com/index2.htm?http://www.sonsothunder.com/devres/revolution/revolution.htm The Tip you're looking for is file010: 'specialFolderPath' codes, under the section labeled File/Folder Manipulation. -- Richard Gaskin Fourth World Media Corporation __ Rev tools and more: http://www.fourthworld.com/rev ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
on setPref prefName,prefData put prefData into preferencesData[prefName] put the keys of preferencesData into theKeys repeat with x=1 to the number of lines in theKeys put line x of theKeys = preferencesData[(line x of theKeys)] cr after newData end repeat put newData into url (file:Preferences.dat) end setPref Hi Derek, There doesn't look to be anything wrong with this script, but there are 2 things you could check: 1. check what newData contains before writing it - maybe it really is empty for some reason and it isn't the put URL at fault. 2. check the defaultFolder - maybe your Preferences.dat file is being written in different places at different times. HTH, Sarah ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
On 5 May 2005, at 22:52, Derek Bump wrote: Dave Cragg wrote: Is preferencesData declared as a global (or local) variable somewhere? (e.g. at the top of the script.) If not, the data won't persist and the array will only contain a single element (the one just added) when you get to the repeat loop? It's a global that's declared at the beginning of my common library. My intention is to use my common library for preferences so I can get away from the Registry and ease the port to MacOS X. You should check the result after the Put ... into url line. This will tell you if an error occurred. Yeah, the result just returns empty. In that case, I'd check that your script has really changed the data to be written to the file. on setPref prefName,prefData put prefData into preferencesData[prefName] put the keys of preferencesData into theKeys repeat with x=1 to the number of lines in theKeys put line x of theKeys = preferencesData[(line x of theKeys)] cr after newData end repeat put newdata ## CHECK HERE that the data is what you expect put newData into url (file:Preferences.dat) end setPref Also, when you say every time afterward it will not write anything do you mean the file remains as it was before or that it is empty? Cheers Dave ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Sarah Reichelt wrote: There doesn't look to be anything wrong with this script, but there are 2 things you could check: 1. check what newData contains before writing it - maybe it really is empty for some reason and it isn't the put URL at fault. I checked the newData variable and it does contain data. 2. check the defaultFolder - maybe your Preferences.dat file is being written in different places at different times. :) Yeah, I just checked this as well. Nope, the default folder hasn't changed. Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution
Re: put into URL not putting
Dave Cragg wrote: Also, when you say every time afterward it will not write anything do you mean the file remains as it was before or that it is empty? I mean that the file remains as it was. About the only way I could ever get it to update the file is to close Revolution. Open it again and then set my preferences. Then it updates the prefs file, and then after that it doesn't update anymore. I think though at this point that I'll go the route of placing a stack somewhere and writing the prefs to that. I just wish I could avoid that route. Thanks everyone for your help! Derek Bump Dreamscape Software ___ Compress Images Easily with JPEGCompress http://www.dreamscapesoftware.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com http://lists.runrev.com/mailman/listinfo/use-revolution