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

[CS4-XP SP3-JS] Relative path bug?

New Here ,
Dec 09, 2008 Dec 09, 2008
var myFile = new File(icon.png); alert(myFile.toSource); returns the wrong path. for example if script is in scriptPanel/testing folder path returned is from XHTML folder. any correction or workaround appreciated. I don't really want to work with activeScript since I want to use as part of relative path in ScriptUI resource string.
TOPICS
Scripting
867
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 ,
Dec 09, 2008 Dec 09, 2008
Hi ABC GREEN,

I'm not sure about the bug, but I do want to point out that you don't have to use a resource string to create UI elements with ScriptUI.

Just because most of the ScriptUI examples show resource strings doesn't mean it's the best approach--in fact, I never use resource strings.

Thanks,

Ole
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 ,
Dec 09, 2008 Dec 09, 2008
Thanks Olev for the reply. I realized in searching the forums that you don't prefer resource strings. However I like the separation it provides between the dialog and the code. Anyway I'm still needing assistance.
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
Guest
Dec 09, 2008 Dec 09, 2008
Absolutely. I have never written a resource string and never will. Just too darned hard to debug, and not worth the effort.

But if you really want some fun in InDesgin scripting, head over to adobe labs and download PatchPanel. With PP you're developing your UI's with Flex; they're much more capable. With FlexBuilder 3, it's at least a factor of 30% faster to develop for InDesign (or any of the CS apps). You can even write and app for InDesign and make calls directly into Photoshop (or any other CS app) from your ID application without having to use BridgeTalk.

With the exception of little utility scripts and stuff to support PatchPanel, I doubt I'll be writing in ExtendScript any more.

Bob
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 ,
Dec 09, 2008 Dec 09, 2008
Bob that looks interesting. Is there going to be a forum to support pp? is having only indesign cs4 enough to create ?
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
Guest
Dec 09, 2008 Dec 09, 2008
There is a forum on Adobe Labs. Not much in it yet, though (PP was only put up on adobe labs a couple of weeks ago.

You need FlexBuilder 3 as the development environment. Beyond that, it's only the PatchPanel library file you download from the site. PatchPanel supports both CS3 and CS4.

In my experience with PP so far, the cost of FlexBuilder is recouped very quickly.

Bob
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
LEGEND ,
Dec 09, 2008 Dec 09, 2008
Hi Bob,

WOW! PatchPanel looks very very interesting!!!

Thanks!

--
Harbs
http://www.in-tools.com
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 ,
Dec 09, 2008 Dec 09, 2008
Fellow Scripters,

I'll have some PatchPanel examples of the InDesign example scripts available shortly.

There are lots of things to get used to in going from ExtendScript to ActionScript--the lack of eval() is only the tip of the iceberg. You can't just move ExtendScripts directly to ActionScript--it'll take some work to port scripts over. And the UI seems a slow compared to InDesign dialogs or ScriptUI.

But there are some cool things that you can do.

Thanks,

Ole
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 ,
Dec 09, 2008 Dec 09, 2008
Slow UI might be a deal breaker for me. I guess time will tell.
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
Guest
Dec 09, 2008 Dec 09, 2008
LATEST
There are a few tricks. Make the UI during ID startup, move it off to the left so as to be invisible.

I don't think the UI is all that slow in terms of response to user events. It does take significantly longer to initialize (it has to load and initialize an SWF).

All of the UI is shown in a Flash panel inside a ScriptUI palette or dialog. With CS4 in ID and PS you can even load your swf into a palette that is dockable (acts like a fully native palette - see the Kuler extension in CS4).

So far I've been able to work through anything I used eval() for in the past. Which is not to say that it can always be done. You do have the ability to call ExtendScript any time and perform an eval() Something like:

com.adobe.cs3.ExtendScript.eval( "alert( 'Howdy' );" );

works just fine.

You can also register callbacks in ES. Using that mechanism you can still use APID for events, for example.

From my limited, totally selfish perspective, PP is the best extension creation toolset to come out of Adobe since ExtendScript.

Rememeber you have access to all that cool flash stuff - you can play videos, sounds, consume web services. How 'bout a palette that shows what's showing in Bridge, and gives you control of bridge as well? Or one that puts up a thumbnail display of your favorite stock photo provider, or... or...

Bob
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