• 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: Writing multiple files to clipboard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing multiple files to clipboard


  • Subject: Re: Writing multiple files to clipboard
  • From: email@hidden
  • Date: Sat, 11 Dec 2010 15:35:35 -0800

This appleScript list is a data type unique to appleScript.  The Finder UI doesn't know what to do with it.

If you coerce the list to text it should work.

Try this:

set fileList to {theFile1, theFile2}
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {return}

set the clipboard to fileList as text
set AppleScript's text item delimiters to oldDelims
the clipboard

HTH,

ES
On Dec 11, 2010, at 12:53pm, Robert Krüger wrote:

>
> Hi,
>
> I'm failing to achieve a seemingly simple thing. I want to write files into the clipboard so they can be pasted into Finder.
>
> This works well for a single file, using this code:
>
> set theFile to POSIX file "/users/krueger/tmp/file1.dat"
> set the clipboard to theFile
>
> However, when I try to put multiple files into the clipboard by the naive approach,
>
> set theFile1 to POSIX file "/users/krueger/tmp/file1.dat"
> set theFile2 to POSIX file "/users/krueger/tmp/file2.dat"
> set fileList to {theFile1, theFile2}
> set the clipboard to fileList
>
> I don't get a "Paste Items" menu entry in Finder.
>
> When I compare clipboard info to when I actually select those files in Finder, there is a difference. With my code the clipboard data is listed a "list" while for the data put into the clipboard by Finder it is "class furl".
>
> Any hints appreciated.
>
> Cheers,
>
> Robert
>
> P.S.: Is it normal that the list archive search doesn't work? I've been trying for the past two days. Browsing through the archive month by month is not really an option. Is there a non-apple searchable archive that anyone can recommend?
>
> _______________________________________________
> 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

 _______________________________________________
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: Writing multiple files to clipboard
      • From: Robert Krüger <email@hidden>
References: 
 >Writing multiple files to clipboard (From: Robert Krüger <email@hidden>)

  • Prev by Date: Writing multiple files to clipboard
  • Next by Date: Re: Script to capture a window...
  • Previous by thread: Writing multiple files to clipboard
  • Next by thread: Re: Writing multiple files to clipboard
  • Index(es):
    • Date
    • Thread