Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript cannot resolve alias references in a File Vault Home Dir.

AppleScript cannot resolve alias references in a File Vault Home Dir.
Thread Tools
Diggory Laycock
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 19, 2003, 07:50 AM
 
Title says it all:

I have friend who wanted an AppleScript to change the extension of certain types of files:

He has File Vault enabled - I don't.

The Script works for me, but not for him.

The following code is the problem:

Code:
to changeToPDF(added_items) tell application "Finder" repeat with aFile in added_items display dialog ("You have chosen file: " & aFile) buttons {"OK"} default button 1 giving up after 2 if name of file aFile contains {".aspx"} then set theDate to (current date) -- Make the time suitable for a file name (replace ":" with ".") set timeText to time string of theDate etc......
the line:
Code:
if name of file aFile contains {".aspx"} then
fails on the FV-enabled machine with the error:

"can't make name of item 1 of {alias "willbank:Downloads:Control.3.aspx"} into string"


Am I doing something wrong - or is this a bug?

Someone else seems to have the same problem:

http://macslash.org/AskMacSlash/03/10/26/1848225.shtml (search for "script")
     
Diggory Laycock  (op)
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Dec 19, 2003, 10:29 AM
 
Hmm - it must be something about aliases not resolving across volumes - since with file vault the home Dir. is on another volume.

We worked around it by moving the folder the script was attached to out of his home dir. and into the shared dir.
     
MarkDouma™
Fresh-Faced Recruit
Join Date: Apr 2003
Location: Grand Rapids, MI
Status: Offline
Reply With Quote
Feb 7, 2004, 08:54 AM
 
I've filed this as BUG ID # 3519134: AppleScript problem with files on "non-mounted" volumes.

Hopefully it will be fixed soon....
     
suthercd
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Feb 7, 2004, 12:25 PM
 
Try:
Code:
tell application "Finder" repeat with aFile in added_items if afile contains {".aspx"} then
Since you have used the Finder, the item returned by aFile is the name of the item. So asking for the name of the name does not make sense. Also, by saying file aFile you are trying to make a reference using aFile which is a string.

If you want to change to extension of a file you can use the Standard Additions scripting addition.
Code:
set myFolder to choose folder set file_list to {} tell application "Finder" set _list to every file of myFolder as alias list end tell repeat with aFile in _list set file_ext to name extension of (info for aFile) display dialog file_ext end repeat
Take a look at the dictionary for Standard additions. Good stuff.

I don't see enough of your code to know about a remote volume.

HTH
Craig
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:22 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,