[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Modules] glue finder and alias references



I'm trying to do something somewhat simple - set the name of a folder using
a Finder glue.

Yes, I could do it other ways, including using perl commands (rename,
maybe?), or File Manager routines.  But, honestly, I don't know how to use
either of those things to change the name of a folder.  I *do* know how to
do it using the Finder, though.

I thought using a glue should be straight forward -
#************
use strict;
use Mac::Glue ':all';

my $finder = Mac::Glue->new('Finder');

my @files = @ARGV;
$finder->set($finder->obj(property =>'name', of => $finder->obj(alias =>
$files[0])), to => "Pudge");
__END__
Which would hopefully change the name of the first thing dropped on it to
"Pudge".  Obviously, this is a test script.

However, it complains -
# Can't find property ''.

File 'Dev:Pseudo'; Line 7

It generates the following AEs:
Process("Finder").SendAE "fndr,fopn,fsel:obj {want:type(cfol),
from:'null'(), form:name, seld:"Nandor"}, APPL:obj {want:type(file),
from:'null'(), form:name, seld:"folderrename"}"

Process("MacPerl").SendAE
"misc,dosc,'----':[alis(«00000000018800020000074A6566662D48440000000000000000000
000000000000000000000ABA7815842440000000000120C666F6C64657272656E616D65000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000004AB60B3D8AEA84150504C4D72504CFFFFFFFF000000110000000000000000000
000000000000E4465736B746F7020466F6C6465720001000400000012000200234A6566662D48443
A4465736B746F7020466F6C6465723A666F6C64657272656E616D6500000900A800A86166706D000
00000000300180039005900750095009E0C48696562696E67205A6F6E65000000000000000000000
0000000000000000000044A656666000000000000000000000000000000000000000000000000000
000074A6566662D48440000000000000000000000000000000000000000044A65666600000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0FFFF0000»),
alis(«666F6C64014600020001074A6566662D484400000000000000000000000000000000000000
00ABA781584244000000000012064E616E646F720000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000004AB
21B3D8A8CC0024001003D00510FFFFFFFF00000011000000000000000000000000000900A800A861
66706D00000000000300180039005900750095009E0C48696562696E67205A6F6E65000000000000
0000000000000000000000000000044A656666000000000000000000000000000000000000000000
000000000000074A6566662D48440000000000000000000000000000000000000000044A65666600
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000FFFF0000»)]"

Where as, this simple little AppleScript
tell application "Finder"
	set name of alias "Jeff-HD:Desktop Folder:Nandor:" to "Pudge"
end tell

generates these:
Process("Finder").SendAE "core,setd,'----':obj {form:prop, want:type(prop),
seld:type(pnam), from:obj {want:type(alis), from:'null'(), form:name,
seld:"Jeff-HD:Desktop Folder:Nandor:"}}, data:"Pudge""

-Jeff Lowrey



==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-modules-request@macperl.org