Re: issues with a find
Re: issues with a find
- Subject: Re: issues with a find
- From: Axel Luttgens <email@hidden>
- Date: Mon, 17 Aug 2015 22:53:47 +0200
> Le 17 août 2015 à 14:57, Die Fledermaus <email@hidden> a écrit :
>
> Okay I am trying to get this script to work. It works up to the point I try to find the temp file for the .mp4 file. I am using the shell script "find" because I am not able to get set xfileExists to (the file in the mypath whose name contains finname and extension contains ".mp4.sb-") to work,
Hello,
Let’s say I have a file named "aaa.bbb.ccc" on my desktop.
Strictly speaking, a file’s extension is the part of its name that comes after the last dot, if any; in this case, the extension is "ccc".
On the other hand, since you’re scripting the Finder, the relevant property is "name extension", not "extension".
So, let’s try:
tell application "Finder"
tell desktop
name of file "aaa.bbb.ccc"
--> "aaa.bbb.ccc"
name extension of file "aaa.bbb.ccc"
--> ""
end tell
end tell
That’s because (on my system) a piece of text such as ".ccc" at the end of a file name has no meaning for the Finder: no launch services bindings.
Other applications may appear to take the concept of file extension more literally:
tell application "System Events"
tell desktop folder
name of file "aaa.bbb.ccc"
--> "aaa.bbb.ccc"
name extension of file "aaa.bbb.ccc"
--> "ccc"
end tell
end tell
Anyway, asking the Finder (or any other application) to pick files whose extension contains ".mp4.sb-" doesn’t make sense, since the extension of such files could only be a string beginning with "sb-".
Since your script is quite complicated, I’m just guessing here; perhaps could you try with something similar to this one:
files of folder mypath whose name begins with (finname & ".mp4.sb-")
(I can’t decide whether ".mp4" is supposed to belong to finname or not)
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