Jump to content
Developer Wiki and Function Reference Links ×

Crossing Over in vectorscript


Recommended Posts

Hello,

I'm a Long time script dabbler, and have a quick question. Recently a friend of mine (who I share vectorscript with) crossed over to the Mac platform. Are there many differences that I need to look out for when placing them on his computer. It seems most work, but scripts that write / read to or from a file seem to not work. Is there a standard practice that anyone uses to compensate for the way MAC & PC handle the way they write / read from files?

Thanks in Advance.

Jeff Miller

Link to comment
  • 2 weeks later...

I am a cross-platform scripter. Whereby I prefer by far to script under Mac.

Simply take care that your text editor under win opens the file encoded in MacRoman, then everything is fine. Even under Windows.

There are some dialog items widths differences, which you'll get fast enough, like dialog items with scroll or arrow bar interpreting the assigned width with or without the bars depending on the platform.

There are some differences in the implementation of List Browsers, which are due to the deep platform dependency of these particular dialog items.

XML routines, even if the parser available to VS is supposedly unicode savy, will suffer the dialog limitations of MacRoman (I believe), so chars above ascii 128 will turn out wrong on Win (which will read it in ANSI, all of a sudden) . That's the only real difficulty for platform crossing. And by no means that easy to solve.

Anything else are bugs and you should report them. In my experience this kind of bugs get fixed pretty fast.

orso

Link to comment

I'm not a cross-platform scripter, but aren't there some differences in how you state a literal file-path?

If you're actually specifying a path (rather than letting the PIO find the data file in the plug-ins folder without a literal path) there may be a 'gotcha'.

It seems I've heard of something to watch out for in this area. Maybe there's a 'wrong' way to handle data files and $includes.

(just seeing if I can jog something loose from the collective consciousness}

Link to comment

You can use relative paths, and this is actually what you should do.

I keep 4 workgroup locations for the includes which span between Mac and Pc, VW 13 and 14.

But the includes are the same: one folder.

There are some fine differences between VW builds:

* VW 13: will allow a text file (xml or anything) to be referenced even if the file is an alias/link. This doesn't work in VW 14.

* VW 13 and 14: you can use aliases of the whole includes folders if the relative path points to a common location above the standard plug-ins folder

Example: workgroup folder > Plug-ins

Alias with all your includes placed in Workgroup Folder: the singular plug-in point to two levels above (or more, if your pios are themselves in folders).

It works on both versions.

The real folder of your includes might be anywhere.

This is an extremely relevant piece of knowledge if you don't only develop for two platforms, but also between versions. And as you know plug-ins with parameters convert going to a version above. And not always you wish to hack them back.

Chars above ASCII 128 should be avoided.

This might not be a problem for you (Canada) but is indeed a nightmare in countries where diacriticals or worst are used, like where I live: Germany.

All system specific chars in general must be avoided:

badCharsMac := ':/.';

badCharsWin := ';,\*"<>\|?';

badCharsSamba := '!+{}&[]?';

badCharsCode := '#%$';

Another piece of knowledge: under unclear circumstances under windows you'll have paths break if the user double-clicked on a file instead of opening the application first and opening the file from there. This is a known issue.

The path turns into a shortcut. It is not a VW problem, actually, is a Window setting. The path breaks nevertheless, no resources, nothing at all will be found.

ciao,

orso

Link to comment

Let's say i want to write a text file to a MAC or to a PC.

I have a few scripts that write and read to a PC and need to add or edit the code so they will write to a MAC also.

What are the real differences i will encounter. Do i add a ".txt" to the end of the file name or should i avoid that?

I am not familiar with mac protocols at all.

Figuring out what platform i am on should not be too difficult, so i guess i should use IF statements and write or read the files appropriately.

Thanks in Advance

Jeff Miller

Link to comment

The file should just be encoded MacRoman. This will avoid you any problem.

The notes in the previous posts still apply.

As to the extension: you do well to add it.

Mac won't say no to an extension. Mac doesn't ACTUALLY need an extension, if a file is coded internally (this is not the case of our text-based files).

Also there are a number of peculiarities as to the available file-IO routines, for this you will like to study the api in the official documentation and perhaps deepen it on VSFR by Charles Chandler, where we all add our observations: http://scs-inc.us/Other/VSFR/default.php?

I am sure you know it already, I won't bother you with further reading suggestions.

ciao,

orso

PS

what is exactly that fails when you try cross-platform?

You can mail me at vectorlab.info. I am living this forum now.

Almost all VS system is still fully mac. It has been ported to PC, but is mac. So it works flawlessly on both platforms, with very very few exceptions. The first to catch eventual exceptions are the folk at NNA self, developing plug-ins for both.

I am horrified :) to say that they really leave just crumbles to fox-terrier as me to find....

Edited by _c_
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...