Re: AS Application
Re: AS Application
- Subject: Re: AS Application
- From: "Steffan A. Cline" <email@hidden>
- Date: Tue, 29 Sep 2009 08:23:48 -0700
- Thread-topic: AS Application
Philip,
It's been interesting to see how you have handled the code differently than
I dd. A new learning experience. The thing that concerns me is that the way
you are really doing the file chooser no differently than I am. What was
strange for me is that when the dialog pops up on a Swedish system, ALL
files are grayed out - including the .js and .css files which are supposed
to be allowed.
I haven't yet tried Yvan's method yet but his seems to identify the file
type differently than just checking by filename.
I think your solution may solve the issue of the root drive properly being
identified.
All good points I'll be trying out hopefully tonight.
on 9/29/09 5:27 AM, Philip Aker at email@hidden wrote:
> On 2009-09-28, at 06:45:54, Steffan A. Cline wrote:
>
>> Aside from the file chooser not allowing anything issue under Swedish
>> localized OS, I came across another issue. My code seems to NOT be always
>> drawing the correct original path in the save as dialog. If the app opens and
>> saves the file with no user interaction, it works fine. This issue happened
>> with another user under Swedish localization.
>
>> Anyone seen this or should I post it to the bug reporter?
>
> A few years ago, on another scripting list, there were a lot of problems being
> reported by a guy with a Swedish setup. Had to do with canonically decomposed
> character sets. So one potential problem area could be that you are rolling
> your own for path splitting, etc. Here's an example which bypasses those
> areas. No guarantee that it will perform any better on a Swedish system but it
> could be a step towards locating the source of the problemĀ
>
> on yui_compress(theFileAlias)
> set finfo to info for theFileAlias
> set pp to POSIX path of theFileAlias
> set ext to name extension of finfo
> if (ext is not in {"js", "css"}) then
> display dialog "The extension \"" & ext & "\" is not supported by the YUI
> compressor." buttons {"OK"} default button "OK" with icon stop
> return
> end if
> set prefix to (do shell script "tclsh <<< 'puts [file rootname {" & pp &
> "}]'")
> set newname to prefix & ".min." & ext
> set jar to (quoted form of POSIX path of (path to resource
> "yuicompressor-2.4.2.jar"))
> set java to "java -jar " & jar & " " & (quoted form of pp) & " -o " & (quoted
> form of newname) & " --charset utf-8"
> try
> do shell script java
> on error errs number errn
> if (errn is not -128) then
> display dialog "Problem with: " & pp & return & return & errs buttons {"OK"}
> default button "OK" with icon stop
> end if
> return
> end try
> end yui_compress
>
> on open theFileList
> repeat with f in theFileList
> yui_compress(theFileList)
> end repeat
> end open
>
> on run
> set choice to choose file with prompt "Select a .js or .css file to be
> minimzed." of type {"js", "css"} with multiple selections allowed
> open choice
> end run
>
Thanks
Steffan
---------------------------------------------------------------
T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
email@hidden Phoenix, Az
http://www.ExecuChoice.net USA
AIM : SteffanC ICQ : 57234309
YAHOO : Steffan_Cline MSN : email@hidden
GOOGLE: Steffan.Cline Lasso Partner Alliance Member
---------------------------------------------------------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden