Re: file list as data
Re: file list as data
- Subject: Re: file list as data
- From: "koenig.yvan" <email@hidden>
- Date: Tue, 22 Jul 2014 22:53:30 +0200
Le 22/07/2014 à 21:13, Jan E. Schotsman <email@hidden> a écrit :
> Hello,
>
> I need to make a script for a user that passes a file list as data.
>
> --script that converts the movie files in folder <myFolder> inside the movies folder
>
> set moviesFolder to path to movies folder from user domain
>
> tell application "System Events"
> set myMoviesfolder to folder "<myFolder>" of moviesFolder
> set myMoviesList to files of myMoviesfolder whose kind is "QuickTime Movie"
> tell application "JES Deinterlacer"
> make new project with data {preset:"2x speed", file:myMoviesList}
> end tell
> end tell
> end tell
>
> -- end script
>
> This results in the error "Can't make file [...] into the expected type
> I tried file:myMoviesList as alias list but this doesn't even compile
>
> I can convert one file like this:
>
> set thePath to POSIX path of item 1 of myMoviesList
> tell application "JES Deinterlacer"
> make new project with data {preset:"2x speed", file:POSIX path thePath}
> end tell
>
> Don't ask me why this works but it does (maybe I was just lucky when a wrote the script this way the first time).
> What I need is {POSIX file thePath1 , POSIX file thePath2}
>
> I tried
>
> set thePosixFileList to {}
>
> repeat with movieFile in myMoviesList
> set thePath to POSIX path of movieFile
> set posixFile to POSIX file & thePath
> set thePosixFileList to thePosixFileList & posixFile
> end repeat
>
> Now I get
>
> {POSIX file, thePath1 , POSIX file, thePath2}
>
> Where tf do the commas come from? I don't want the comma's.
> Please help!
>
> Jan E.
May you try to use :
--script that converts the movie files in folder <myFolder> inside the movies folder
set moviesFolder to path to movies folder from user domain
tell application "System Events"
set myMoviesfolder to folder "<myFolder>" of moviesFolder
set myMoviesList to files of myMoviesfolder whose kind is "QuickTime Movie"
end tell
end tell
set thePosixFileList to {}
repeat with movieFile in myMoviesList
set thePath to POSIX path of movieFile
set posixFile to POSIX file thePath
set end of thePosixFileList to posixFile
end repeat
tell application "JES Deinterlacer"
make new project with data {preset:"2x speed", file:thePosixFileList}
end tell
-- end script
Yvan KOENIG (VALLAURIS, France) mardi 22 juillet 2014 22:53:25
_______________________________________________
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