Re: temporary items
Re: temporary items
- Subject: Re: temporary items
- From: Axel Luttgens <email@hidden>
- Date: Sat, 20 Aug 2011 16:34:30 +0200
Le 19 août 2011 à 20:24, Luther Fuller a écrit :
> I just discovered something else ...
>
> In Lion, I modified the code for "Script Bundle Tool" by adding ONE line ...
>
> on createAppBundle(sourceRef, projectName, projectParams)
> set tempRef to (path to temporary items) --********** from user domain)
> tell application "Finder"
> open window of tempRef -- added this line <<<<<<<<<<<
> set objectRef to (POSIX path of tempRef) & projectName & ".app" as POSIX file
>
> Then I ran SBT with itself as input to create a new build of SBT.
>
> I ran SBT on a test script:
> run 1 ... no errors (expected)
> run 2 ... no errors (but expected one)
> run 3 ... no errors (but expected one)
>
> So, now it seems to be working correctly, but the window of the temporary items folder is opened on my desktop. A little inconvenient, but it works.
>
> This changes the problem with the temporary items folder in Lion.
> Why does it not work correctly unless its window is open?
Hmmm… Going to do some rough guesses, since I still don't understand your exact problem (too many large chunks of code, seemingly unrelated to each other).
Traditionally, the Finder's scripting model reflected what the user was allowed to do in the GUI.
In particular, the ability to act upon invisible items was rather restricted, since such items aren't reachable in the GUI.
Such restrictions seem to have been progressively relaxed thru the consecutive versions of Mac OS X. Perhaps does Lion somewhat revert that trend?
Let's have a look at the output of:
tell application "Finder" to get items of startup disk
No trace of "private", "usr", 'sbin"…
To refer to, for example, folder "private" in fact requires a particular syntax:
tell application "Finder" to get item "private" of startup disk
--> item "private" of startup disk
tell application "Finder" to get folder "private" of startup disk
--> error number -1728 from folder "private" of startup disk
> Do other applications that use the temporary items folder have this problem, too?
If your problem stems from the invisibility of disk items, this should be restricted to Finder scripting.
For example, System Events "knows" about all invisible items at the startup disk's root, as shown by the output of:
tell application "System Events" to get items of startup disk
HTH,
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