Re: Acrobat 6 "do script" problem...
Re: Acrobat 6 "do script" problem...
- Subject: Re: Acrobat 6 "do script" problem...
- From: Hanaan Rosenthal <email@hidden>
- Date: Tue, 11 Nov 2003 14:46:38 -0500
- Organization: Custom Flow Solutions
A little formatting issue:
set theString to +class ktxt; of (theText as record)
should be:
set theString to <<class ktxt>> of (theText as record)
You get these brackets by clicking opt-\ and opt-shift-\
>
>
From: Hanaan Rosenthal <email@hidden>
>
Date: 2003/11/11 Tue PM 02:11:57 EST
>
To: Nigel Smith <email@hidden>, applescript-
email@hidden
>
Subject: Re: Acrobat 6 "do script" problem...
>
>
Here we go:
>
>
When you ask for posix path of the result you get is in styled text, and
>
therefore the entire string is in styled text.
>
Acrobat JAVASCRIPTT seems to choke on that.
>
>
Here's a little routine to pass your string through:
>
>
set f2 to get_string_of_styled_text(f2)
>
>
on get_string_of_styled_text(theText)
>
try
>
set theString to +class ktxt; of (theText as record)
>
return theString
>
on error
>
return theText
>
end try
>
end get_string_of_styled_text
>
>
>
>
>
>
> Gurus,
>
>
>
> Can anyone explain what is going on with this script? Mac OSX
Panther
>
and
>
> Acrobat 6 Pro -- if you have Acrobat's JavaScript Debugger window
>
open you
>
> will see the output:
>
>
>
> -------------
>
> set f1 to "/"
>
> set f2 to POSIX path of ":" as string
>
>
>
> set script1 to "var f = \"" & f1 & "\";console.println(f);"
>
> set script2 to "var f = \"" & f2 & "\";console.println(f);"
>
>
>
> tell application "Acrobat 6.0 Professional"
>
> do script script1
>
> do script script2
>
> end tell
>
> -------------
>
>
>
> Why does "script1" complete, but "script2" error? This is totally
>
> reproducable OMM -- any file path generated as per line 2 above
will
>
error,
>
> the same path typed or pasted in will work.
>
>
>
> Failing that, how do you get the front document in Acrobat using
>
JavaScript
>
> rather than AS? This is to do with Ian's XML export problem in his
>
> "Applescripts for Acrobat 6.0" email.
>
>
>
> TIA,
>
>
>
> Nigel
>
> _______________________________________________
>
> applescript-users mailing list | email@hidden
>
> Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/
>
listinfo/applescript-users
>
> Do not post admin requests to the list. They will be ignored.
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/
listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.