Shirt Pocket Discussions

Shirt Pocket Discussions (https://www.shirt-pocket.com/forums/index.php)
-   General (https://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   Scheduled Copies doesn' work in Japanese Language mode. (https://www.shirt-pocket.com/forums/showthread.php?t=1704)

dnanian 10-22-2006 10:17 AM

That's weird -- I'm helping another user who's having the same problem and the script worked for him in English but not in Japanese. I don't understand why, in English mode, the locale would be Japanese, though you might have to log out and back in to switch locales, or at least quit the application... did you try that?

ichiro 10-23-2006 09:59 AM

I checked System Preferences again.

I obtained the user locale result "en_US" by the following setup.

System Preferences -> International -> Formats
Reagion: United States

SuperDuper! worked with Japanese and English mode without trouble by the following code.
-----------------
tell application "System Events"
set sysInfo to system info

if (characters 1 thru 2 of (user locale of sysInfo)) as string = "j/a" then
set backslashChar to ASCII character 128
else
set backslashChar to ASCII character 92
end if
end tell
-----------------

dnanian 10-23-2006 10:47 AM

Hm. OK -- so, the language choice doesn't change the locale, but the "format" menu does. That doesn't help us much, unforutnately -- and I don't see how the first two characters of ja_JP can be equal to three characters ("j/a").

I'm going to see if I can come up with an alternate approach with Unicode...

ichiro 10-24-2006 06:13 AM

"j/a"
Probably the cause of slash may be Code of the following.

/Applications/SuperDuper!.app/Contents/Resources/Copy Job Script.template
-----------------
set the text item delimiters to "/"
-----------------

dnanian 10-24-2006 10:22 AM

Ah! Yes, that would explain it: I don't have that in my example (since it's not at the top of on run, where I indicate the code should go).

So, if you move it to the top of "on run", does it then work?

ichiro 10-28-2006 08:52 AM

> Under the comment about Japanese backslashes at the top, put the following:
> global backslashChar
> Delete the declaration of backslashChar in the two encode routines.
> At the start of on run (lower down), please put:

I did not understand the above explanation.
I challenged again.
SuperDuper! schedule worked with both Japanese and English mode without trouble by the following fix.


fix-01
------------------------
-- of the backslash character in the Japanese OSX environment under Panther. Backslash and the Yen symbol are the
-- same ASCII code, but the script compiler doesn't handle it properly, and the following characters
-- are not escaped.

global backslashChar
------------------------


fix-02
------------------------
on encode_char(this_char)
set the ASCII_num to (the ASCII number this_char)
set the hex_list to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
-- set backslashChar to ASCII character 92
------------------------


fix-03
------------------------
on encode_text(this_text, encode_URL_A, encode_URL_B)
set the standard_characters to "abcdefghijklmnopqrstuvwxyz0123456789"
set quoteChar to ASCII character 34
-- set backslashChar to ASCII character 92
------------------------


fix-04
------------------------
on run {}
tell application "System Events"
set sysInfo to system info
if (characters 1 thru 2 of (user locale of sysInfo)) as string = "ja" then
set backslashChar to ASCII character 128
else
set backslashChar to ASCII character 92
end if
end tell
------------------------

dnanian 10-28-2006 10:11 AM

Yes, that's basically what I did -- I must not have communicated it well above.

Anyway, yes, it works... except "system info" isn't available in 10.3.9, so it's not going to work for those users (and without those users, you can actually use a real backslash character).

Still trying to come up with something that will work for all. I might have to abandon the attempt to work under 10.3.9 for Japanese users (without editing the template).


All times are GMT -4. The time now is 10:57 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2022, vBulletin Solutions, Inc.