Update for L3P Launcher (OSX)


Update for L3P Launcher (OSX)
#1
Aloha,

I modified L3P Launcher to work on my system:

1. Updated the enclosed binary of L3P.
2. Changed the Applescript that it uses to open the processed files in MegaPOV.

Please let me know if it works for you <http://db.tt/1khsbeyK>.

Mahalo,

Ramón
Reply
Re: Update for L3P Launcher (OSX)
#2
For me it generates the .pov file, but does not open pov-ray.

I tried the old version for comparison, which generates the file and does launch pov-ray... although pov-ray does not work on my system, I need to use mega-pov.

Even though mega-pov is set as the default application for .pov files, l3p (the old one) still tries to use pov-ray.
Reply
Re: Update for L3P Launcher (OSX)
#3
Aloha,

I think I fixed it. I forgot that I have GNU sed installed in my computer via FINK. Now, I included a copy inside the application bundle.

Download here: <http://db.tt/1khsbeyK>.

Mahalo,

Ramón
Reply
Re: Update for L3P Launcher (OSX)
#4
Still doesn't launch pov-ray


also...

$ which sed
/usr/bin/sed

and I don't have fink installed, so that's not the issue.
Reply
Re: Update for L3P Launcher (OSX)
#5
I just got my hands on a pretty much default mac running lion (without the developer stuff installed) and sed is present there as well.
Reply
Re: Update for L3P Launcher (OSX)
#6
Aloha,

sed does come with OSX, but I superseded it with gsed, which I got through Fink.

Can you give me the POSIX path of the file(s) you are trying to process (e.g. "/Users/ramon/Documents/LEGO/Models/LEGO Deluxe Brick Box 5508/F1 Racer.ldr")?

Mahalo,

Ramón
Reply
Re: Update for L3P Launcher (OSX)
#7
For the "Recent Messages" preview... Here lies a really long analysis of the proposed fix.

Kindof a funkey setup here, it was previously on a different partition, I have a symlink from /Users/jpouellet/Desktop -> /Volumes/SHARE/Desktop, where SHARE is an NTFS partition that I share between OS X and OpenBSD when I dual boot, and the file path was /Volumes/SHARE/Desktop/asdf.ldr and I was telling L3P to access it as /Users/jpouellet/Desktop/asdf.ldr, but that wasn't the issue because the symlink is completely transparent, and it was obviously able to read it just fine because it generated a valid POV-Ray output file of the model.

Just to double check that it wasn't the problem, I moved the file to /asdf.ldr and got the same results (.pov generated, POV-Ray not launched).

In any case, there aren't any special characters in the file path or anything (which I suspect is the reason you asked about the path).

I looked further into what was changed to try to figure out exactly what you did to make it "work on your system."

I assume, based on what I saw, that what wasn't working on your system, was not L3P Launcher itself, but in rather POV-Ray, and thus you resorted to using MegaPov, just as I have myself.

From what I can gather, you created another application (Open in MegaPOV.app) which, as far as I can tell, is just a wrapper for another applescript (it has all the defining characteristics of an applescript that was just saved as an "Application" from AppleScript Editor) whose purpose appears to be to gather (from the L3PLauncher gui?) what pov files were created, and open those in MegaPOV.

Haha, and I was still expecting it to launch POV-Ray, but no, "SendOutputToPOV.applescript" has been turned into a launcher for "Open in MegaPOV.app"

Just to be sure, I checked to be certain that AppleScript recognized my MegaPOV installation:
Code:
$ osascript
tell application "MegaPOV" to activate
^D
and yup, it works just fine.

I am curious as to why you bundled the new applescript in an application which is launched by the old applescript file (incurring all the overhead of the data associated with the new application) instead of just modifying the old applescript file, but then again, I don't fully understand the idiosyncrasies of AppleScript.

Now on to the issues of relative file paths...

The so-called applescript
Code:
L3P Launcher.app/Contents/Resources/Open in MegaPOV.app/Contents/Resources/Scripts/main.scpt
is actually being executed by
Code:
L3P Launcher.app/Contents/Resources/Open in MegaPOV.app/Contents/MacOS/applet
and thus has the working directory of
Code:
/Applications/L3P Launcher.app/Contents/Resources/Open in MegaPOV.app/Contents/MacOS/

In the script, you try to execute gsed as ./gsed, which implies that gsed is in the working directory of the currently executing application, which, in this case, it is not, it is in
Code:
/Applications/L3P Launcher.app/Contents/Resources/
which is the same directory as "Open in MegaPOV.app" but (perhaps not intuitively) is not your working directory.

Furthermore, when I tried to execute the version of gsed you distributed, I get the following errors:
Code:
$ /Applications/L3P\ Launcher.app/Contents/Resources/gsed
dyld: Library not loaded: /sw/lib/libintl.3.dylib
  Referenced from: /Applications/L3P Launcher.app/Contents/Resources/gsed
  Reason: image not found
Trace/BPT trap
$ ls /sw/lib/
ls: /sw/lib/: No such file or directory
as well as
[Image: EjnCL.png]
so obviously it must rely on some libraries installed by fink, so it can't just be shipped off as-is and expected to work.

Would it be possible to use normal sed instead of gsed? If not, perl is also an option as it is installed by default on OS X, and you can use the -e flag to specify the code in-line.

As a side note, the beauty of the old POV-Ray launching code was that (back on systems where POV-Ray still worked) it automatically rendered the model as soon as it was opened by POV-Ray. The MegaPPOV code you provided appears to me to primarily be a complicated way of obtaining the name of the file to open, and opening it in MegaPOV. Since its primary function is to open the file, and it doesn't do any gui-scripting of the opening application (as the old code did), I believe it should be opened with

Code:
$ open [i]<the file>[/i]
or in applescript:
Code:
do shell script "open " & quoted form of [i]<the file>[/i]

instead of

Code:
tell application "MegaPOV"
    activate
    open [i]<the file>[/i]
end tell
so that it would use whatever application people set as the default on their system for opening POV files. This way, if POV-Ray does start to work again on mac in the future, the changes to this application would not need to be reverted.

Finally, (perhaps you did this, and I'm unaware) it would be best to modify the sources of this program and not the resulting build. As it stands right now, the next time somebody modifies the source and re-compiles it, your changes will be lost. The sources may be found in L3P_Launcher_.8/source (the directory that contains the Xcode project) in the download found on the page I linked to earlier.




Phew, this took a long time to write, hope it helps, at least a little.
Reply
Re: Update for L3P Launcher (OSX)
#8
Aloha,

Jean-Philippe Ouellet Wrote:I am curious as to why you bundled the new applescript in an application which is launched by the old applescript file (incurring all the overhead of the data associated with the new application) instead of just modifying the old applescript file, but then again, I don't fully understand the idiosyncrasies of AppleScript.

The applescript would freeze otherwise. This was a quick fix for that.

Jean-Philippe Ouellet Wrote:From what I can gather, you created another application (Open in MegaPOV.app) which, as far as I can tell, is just a wrapper for another applescript (it has all the defining characteristics of an applescript that was just saved as an "Application" from AppleScript Editor) whose purpose appears to be to gather (from the L3PLauncher gui?) what pov files were created, and open those in MegaPOV.

Correct. I also modified its Info.plist to make it faceless.

Jean-Philippe Ouellet Wrote:Would it be possible to use normal sed instead of gsed?

Yes, I fixed that. The /usr/bin/sed works just fine, there was no need for gsed.

Jean-Philippe Ouellet Wrote:As a side note, the beauty of the old POV-Ray launching code was that (back on systems where POV-Ray still worked) it automatically rendered the model as soon as it was opened by POV-Ray. The MegaPPOV code you provided appears to me to primarily be a complicated way of obtaining the name of the file to open, and opening it in MegaPOV. Since its primary function is to open the file, and it doesn't do any gui-scripting of the opening application (as the old code did), I believe it should be opened with[...]

I believe the old POV-Ray launching code did not open the files, instead it opened the batch file dialog. I tried to get it to work the way you suggest (open and then render) but couldn't.

You are right, obtaining the path (not just the name, which would be relatively easy) of the file to open is complicated.

Also, I rather specify that MegaPOV be the application that opens the files. This is because to have MegaPOV work one must have the non-functioning POV-Ray installed, and if the user forgets to make MegaPOV the default application for POV files then we would run into a problem.

I made a cosmetic change to the L3P Launcher main window. Now, it says "send to MegaPOV when done".

Please re-download at <http://db.tt/1khsbeyK>. If it still does not work, please send me the content of the "L3P Output" window.

I will bundle everything, with the source code, when (if?) we get it working.

Mahalo,

Ramón
Reply
Re: Update for L3P Launcher (OSX)
#9
It does open it with MegaPOV now (doesn't render, not sure it it was supposed to or not).

However, if I have "Enable access for assistive devices" turned off (and only in that case as far as I can tell), I get this error message:
[Image: Tdcth.png]

For the record (in case anything ever happens to images), and for searchability, it says:

The error message Wrote:I could not send to MegaPOV!
System Events got an error: Can't
make application "System Events" into
type number or string.
-1700
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)