• 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: Can't get every document file of every folder of startup disk whose creator type = "MSIE"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get every document file of every folder of startup disk whose creator type = "MSIE"


  • Subject: Re: Can't get every document file of every folder of startup disk whose creator type = "MSIE"
  • From: Bill Hernandez <email@hidden>
  • Date: Wed, 3 Jan 2007 02:05:47 -0600

Here's some feedback I got on another list....

The problem lies in how you're building your list of files.

The Finder will only return an 'alias list' when you get the files in question.

Your script, however, tries to combine two separate lists then coerce it to a alias list... it's being interpreted as:

((get every document file in folder thePath) & (get every document file of every folder in folder thePath)) as alias list


which, indeed, doesn't work.

However, if you re-work the statement, it does work:

set aSel to (every document file in folder thePath as alias list) & (every document file of every folder in folder thePath as alias list)


Now, since the Finder can coerce the list to an alias list as it gets the files.


Camelot


I tried it and sure enough it works so BBEdit can use the alias list...

Best regards,

Bill Hernandez
Plano, Texas




On Dec 9, 2006, at 9:25 AM, Jim Correia wrote:


On Dec 9, 2006, at 1:03 AM, Bill Hernandez wrote:


I use "set aList to get every file of every folder in startFolder" the references are to "document file path2file" instead of "alias to path2file", and I was not successful getting BBEdit to work with them without generating errors


The open event requires a list of file references (aliases). This is true of all scriptable applications, not just BBEdit.


Normally you can coerce Finder object references to aliases. In this case a bug in the Finder is getting in your way.

	set aList to get every file of every folder in startFolder

This is returning invalid object references - ones not even the Finder can resolve at a later date.

It seems to drop one level of hierarchy when building the object specifiers in response to that whose clause. You can avoid the Finder bug by using some alternate means of building up the file list.

Jim



On Jan 3, 2007, at 1:48 AM, Bill Hernandez wrote:

-- +---------+---------+---------+---------+---------+---------+
on script_title()
(*
Filename : get_every_file_of_every.scpt (Script Debugger)
Author : Bill Hernandez
Version : 1.0.0
Updated : Tuesday, January 02, 2007 ( 6:15 PM )
*)
end script_title
-- +---------+---------+---------+---------+---------+---------+
on script_notes( )
(*
This is a work around to the alias list problem I encountered
*)
end script_notes
-- +---------+---------+---------+---------+---------+---------+
tell application "Finder"
activate
set thePath to choose folder

-- THIS DOES NOT GIVE THE CORRECT ANSWER --> as alias list, instead it returns a document list
set aSel to (((every document file in folder thePath) & (every document file of every folder in folder thePath)) as alias list)


-- THIS WORKS PERFECT
set aSel to (every document file in folder thePath as alias list) & (every document file of every folder in folder thePath as alias list)

display dialog ("[2451] " & (get modification date of (item 1 of aSel)) as string)

set f_info to info for (alias ((item 1 of aSel) as text))
display dialog ("[2452] " & (get modification date of f_info) as string)

-- THIS DOES THE TRICK, it returns an alias list
set aSelection1 to (every document file in folder thePath) as alias list
set aSelection2 to ((every document file of every folder in folder thePath)) as alias list
set aSelection to (aSelection1 & aSelection2)

display dialog ("[2453] " & (get modification date of (item 1 of aSelection)) as string)

set f_info to info for (alias ((item 1 of aSelection) as text))
display dialog ("[2454] " & (get modification date of f_info) as string)
end tell
-- +---------+---------+---------+---------+---------+---------+

_______________________________________________ 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/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Can't get every document file of every folder of startup disk whose creator type = "MSIE" (From: Bill Hernandez <email@hidden>)

  • Prev by Date: Re: Can't get every document file of every folder of startup disk whose creator type = "MSIE"
  • Next by Date: Re: Outcome is incorrect of grouped "group boxes"
  • Previous by thread: Re: Can't get every document file of every folder of startup disk whose creator type = "MSIE"
  • Next by thread: LART/LRT (Was: Irritating list reply-to policy)
  • Index(es):
    • Date
    • Thread