Re: file path problem
Re: file path problem
- Subject: Re: file path problem
- From: Jean-Christophe Helary <email@hidden>
- Date: Thu, 30 Jun 2011 23:29:58 +0900
Alex and Michelle,
Thank you for the suggestions.
So, basically, if I use "text" to create the path I'll have issues with ":" and if I use POSIX for that I'll have issues with "/". Is that correct ?
Jean-Christophe
On Jun 30, 2011, at 8:17 PM, Axel Luttgens wrote:
> Le 30 juin 2011 à 10:36, Jean-Christophe Helary a écrit :
>
>>
>> I have a script that bumps on this:
>>
>> tell application "Mail"
>> set job to item 1 of (get selection)
>> set job_info to (get source of job)
>> set job_name to ((get subject of job as text) & ".eml")
>> set job_path to open for access file ((project_folders as text) & "informations:" & job_name) with write permission
>> write job_info to job_path
>> close access job_path
>>
>> The problem is that, when I use that script on a reply (ie a mail that has a ":" in the subject). The script ends with an error:
>>
>> File file Macintosh HD:...:...:...:(part of the subject before":"):(part of the subject after":").eml was not found.
>>
>> My idea is that the ":" in the reply is considered as a folder separator when put into the path and I'd like to avoid that obviously.
>>
>> Is there a way to fix that ?
>
> Hello Jean-Christophe,
>
> You could try with this one:
>
> set job_path to open for access (POSIX file ((POSIX path of project_folders) & "informations/" & job_name)) with write permission
>
> Note that this is a partial fix only, since another problem would occur if the message's subject contains a forward slash...
>
> It would probably be safer to check whether job_name contains columns, and to replace them with some character.
>
> 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
Jean-Christophe Helary
----------------------------------------
fun: http://mac4translators.blogspot.com
work: http://www.doublet.jp (ja/en > fr)
tweets: http://twitter.com/brandelune
_______________________________________________
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