• 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: make new folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make new folder


  • Subject: Re: make new folder
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 1 Jun 2008 21:29:06 -0500

I tried ...

tell application "System Events"
set hFolder to (make new folder at the end of xxxxxx with properties {name:"background"})


and it worked, then something strange happened. After this line of code there appears ...

	tell application "System Events"
		move pictFile to hFolder -- tried "at the end of " too
	end tell

It does not error, but it doesn't move the file, either. So I tried ...

	tell application "Finder"
		move pictFile to hFolder
	end tell

This always errors. hFolder, it seems was created by System Events and won't work in Finder.
Trying to convert it to an alias errors also.


Normally, I would have used only Finder, but hFolder was and will be an invisible folder.
All of this is in a script that worked in Tiger and should be easy to fix for Leopard.
But something very strange is going worng.


On Jun 1, 2008, at 7:11 PM, deivy petrescu wrote:

On Jun 1, 2008, at 19:49, Luther Fuller wrote:

I've got this code that ought to work ...

tell application "System Events"
if not (exists folder "background" of xxxxxx) then
set hFolder to (make new folder at xxxxxx with properties {name:"background"})


where xxxxxx is an alias. The first occurrence of xxxxxx always works, but the second always fails. I've tried making the second occurrence a posix path, a reference and some other things, but there's always the error: "System Events can't make xxxxxx into a type location reference." (or sometimes 'integer') I can't figure out what's happening here. Does anyone know?

Luther:
It is easy to forget that, I do it very, very often, but get used to make something at the beginning or at the end of wherever you are making the new stuff.
So,
set hFolder to (make new folder at the end of xxxxxx with properties {name:"background"})
will work.


Deivy

_______________________________________________ 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
  • Follow-Ups:
    • Re: make new folder
      • From: Michelle Steiner <email@hidden>
References: 
 >make new folder (From: Luther Fuller <email@hidden>)
 >Re: make new folder (From: deivy petrescu <email@hidden>)

  • Prev by Date: Re: make new folder
  • Next by Date: Re: make new folder
  • Previous by thread: Re: make new folder
  • Next by thread: Re: make new folder
  • Index(es):
    • Date
    • Thread