• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable)


  • Subject: Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable)
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 17 Apr 2007 18:03:12 +0200

On 17/04/07 16:29, Axel Luttgens wrote:
[...]

But this still doesn't tell the whole story: how can that systematic "1 out of 2" behavior shown by your original script be exactly explained?
I haven't yet managed to get a clear picture...

Of course, part of the explanation must reside in the fact that using shell commands for the creation of the copy somehow short-circuits the Finder: it hasn't the opportunity to do its usual housekeeping.

Here is a "Finder only" version of the script:

    set MyAlias to path to me
    set TmpFolderAlias to path to "flnt"
    tell application "Finder"
        if (container of MyAlias) as alias is TmpFolderAlias then
            display dialog "The copy is running..." giving up after 1
        else
            duplicate MyAlias to TmpFolderAlias replacing yes
            open result
        end if
    end tell

With the above, no need to ask the Finder to update the hidden location any more: the copy is launched every time.
Fine :-)

Let's now try a "shell only" version:

    set MyPath to text 1 thru -2 of POSIX path of (path to me)
    set MyFolderPath to do shell script "dirname " & quoted form of MyPath
    set TmpFolderPath to text 1 thru -2 of POSIX path of (path to "flnt")

    if TmpFolderPath is MyFolderPath then
        display dialog "The copy is running..." giving up after 1
    else
        do shell script "cp -fR " & quoted form of MyPath & " " & quoted form of TmpFolderPath
        set MyName to do shell script "basename " & quoted form of MyPath
        do shell script "open " & quoted form of (TmpFolderPath & "/" & MyName)
    end if

Huho... works too, without even having to play with lsregister.

Either I am missing something, or there is a bug in the way the Finder handles its open command.
Someone?

Axel

 _______________________________________________
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

References: 
 >applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable) (From: "Jason Danielson" <email@hidden>)
 >Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable) (From: Axel Luttgens <email@hidden>)
 >Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable) (From: "Jason Danielson" <email@hidden>)
 >Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable) (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Delete layer in Photoshop
  • Next by Date: Creeping-featuritis
  • Previous by thread: Re: applescript uninstaller delete itself & customizing applescript application bundle binary filename (CFBundleExecutable)
  • Next by thread: Scripting Filemaker 8.5.. (HEEELP)
  • Index(es):
    • Date
    • Thread