Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"enter" in script labels in Mac vs. Windows

New Here ,
Jul 26, 2008 Jul 26, 2008
TOPICS
Scripting
476
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 26, 2008 Jul 26, 2008
Sorry -- I pressed "enter" instead of tab in my initial post. Here's my question:

I'm processing multi-line script labels using carriage returns and/or line feeds as delimiters. However, I'm having trouble writing a script that works on both Mac and Win machines.

Looking at exported INX files, it looks like the "enter" key is represented by different characters on different platforms:

Mac:
Windows:

Does this match others' experience and/or knowledge?

Can one test for platform in a JS, and behave accordingly?

Thanks,
Andrea
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 26, 2008 Jul 26, 2008
So far, carriage returns isn't defined by "\r" ?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 26, 2008 Jul 26, 2008
loic_aigon wrote:
> So far, carriage returns isn't defined by "\r" ?

Yes, but when doing text file IO, that can be remapped to '\r\n' on Windows,
'\n' on Unix, and left as '\r' on the Mac.

-X
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 26, 2008 Jul 26, 2008
LATEST
Try this :
app.selection[0].contents="\u000D"
//Unicode character for carriage return
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines