Closed
Bug 394821
Opened 18 years ago
Closed 18 years ago
Moving a bookmark to a folder via AppleScript deletes the folder (and contents)
Categories
(Camino Graveyard :: OS Integration, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Camino1.6
People
(Reporter: alqahira, Assigned: peeja)
References
Details
(Keywords: fixed1.8.1.13)
Attachments
(2 files, 3 obsolete files)
|
6.67 KB,
patch
|
stuart.morgan+bugzilla
:
superreview-
|
Details | Diff | Splinter Review |
|
9.07 KB,
patch
|
Details | Diff | Splinter Review |
The script
tell application "Camino"
move bookmark "Test" of bookmark bar collection to ¬
bookmark folder "Test ƒ" of bookmark bar collection
end tell
deletes "Test ƒ" (and any of its contents) instead of moving "Test" into the folder ("Test" remains in the bar).
| Reporter | ||
Comment 1•18 years ago
|
||
FWIW, it actually moved the bookmark "Test" to after the last bookmark, if the folder "Test ƒ" was situated among bookmarks.
| Assignee | ||
Comment 2•18 years ago
|
||
Taking. No idea why this is happening, but I'll figure it out.
Assignee: nobody → peter.a.jaros
Blocks: 382493
| Reporter | ||
Updated•18 years ago
|
Flags: camino1.6a1?
| Assignee | ||
Comment 3•18 years ago
|
||
Ah, this script is working correctly. The script that does what you meant would be this:
tell application "Camino"
move bookmark "Test" of bookmark bar collection to ¬
end of bookmark items of bookmark folder "Test ƒ" of bookmark bar collection
end tell
Not so great that what you wrote isn't right; worse that it results in data loss. It's on the agenda for the Oct. 24th meeting.
| Reporter | ||
Comment 4•18 years ago
|
||
Not blocking a1, but peeja has an idea how to fix this that he's going to investigate.
Flags: camino1.6a1?
Flags: camino1.6a1-
Flags: camino1.6?
Comment 5•18 years ago
|
||
Peter, any work on this?
| Assignee | ||
Comment 6•18 years ago
|
||
Nothing new yet, but the semester's over now. I'm getting back to the AppleScript stuff now, though my first task is getting a tree to build again.
| Assignee | ||
Comment 7•18 years ago
|
||
Got it. This patch adds a new MoveCommand handler for the move command. If it's called on to replace something ("move X to Y"), it will alter its arguments to mean "move X to the end of Y". If Y is not a collection, the script errors, which makes sense. Other insertion positions, such as "move X to before Y", work as before.
Project patches for trunk and branch are provided separately.
Attachment #300891 -
Flags: review?(murph)
| Assignee | ||
Comment 8•18 years ago
|
||
Attachment #300892 -
Flags: review?(murph)
| Assignee | ||
Comment 9•18 years ago
|
||
Attachment #300894 -
Flags: review?(murph)
Comment 10•18 years ago
|
||
Comment on attachment 300891 [details] [diff] [review]
MoveCommand(.mm|.h) + Camino.sdef change
Behavior works as expected; with the one code change below, r=murph.
>+ NSMutableDictionary *args = [[self arguments] mutableCopy];
Using |mutableCopy| means you'll have to release |args| after calling |setArguments:|. I'd either tack on an |autorelease| or just use [NSMutableDictionary dictionaryWithDictionary:].
Attachment #300891 -
Flags: review?(murph) → review+
Comment 11•18 years ago
|
||
Comment on attachment 300892 [details] [diff] [review]
Trunk Project Patch
Unfortunately, the project file changed in the last few days, breaking this patch already. You'll need to re-diff :)
Attachment #300892 -
Flags: review?(murph) → review-
| Reporter | ||
Comment 12•18 years ago
|
||
Comment on attachment 300894 [details] [diff] [review]
Branch Project Patch
Cancelling the review request on this, since it's likely bitrotted and we need a new code patch anyway.
Attachment #300894 -
Flags: review?(murph)
| Reporter | ||
Comment 13•18 years ago
|
||
Comment on attachment 300894 [details] [diff] [review]
Branch Project Patch
Cancelling the review request on this, since it's likely bitrotted and we need a new code patch anyway.
| Reporter | ||
Comment 14•18 years ago
|
||
Plussing/targeting 1.6 since this is dataloss and the patch is close.
Can we get an ETA on a new version?
Flags: camino1.6? → camino1.6+
Target Milestone: --- → Camino1.6
| Assignee | ||
Comment 15•18 years ago
|
||
I'll be as soon as I can get a tree building, so probably by tonight. If I can't get it going by tonight, I'll try to get someone else to spin the patch for me.
| Assignee | ||
Comment 16•18 years ago
|
||
+ murph's change.
Attachment #300891 -
Attachment is obsolete: true
Attachment #303176 -
Flags: superreview?(stuart.morgan)
| Assignee | ||
Comment 17•18 years ago
|
||
Again, just adds MoveCommand.*. Probably needs a port to branch, which Smokey offered to do on checkin.
Attachment #300892 -
Attachment is obsolete: true
Attachment #300894 -
Attachment is obsolete: true
Attachment #303180 -
Flags: superreview?(stuart.morgan)
| Assignee | ||
Comment 18•18 years ago
|
||
Comment on attachment 303176 [details] [diff] [review]
Code respin
>Index: src/appleevents/MoveCommand.h
>+ * Portions created by the Initial Developer are Copyright (C) 2007
>Index: src/appleevents/MoveCommand.mm
>+ * Portions created by the Initial Developer are Copyright (C) 2007
Er, make that 2008, would you? I swear I've gotten it right on all my checks...
Comment 19•18 years ago
|
||
Comment on attachment 303176 [details] [diff] [review]
Code respin
>+ NSPositionalSpecifier *newToLoc = [[NSPositionalSpecifier alloc] initWithPosition:NSPositionBeginning objectSpecifier:[toLoc objectSpecifier]];
Three things here:
- Why is this NSPositionBeginning, when the discussion was about putting it at the end (which seems more likely to be the expected behavior)?
- The specificier is leaked, and should be autoreleased on this line.
- The line is really long, and should be broken before |objectSpecifier|
Attachment #303176 -
Flags: superreview?(stuart.morgan) → superreview-
Comment 20•18 years ago
|
||
Comment on attachment 303180 [details] [diff] [review]
Trunk Proj. Patch, clean of bitrot
(No need for separate review of project bits)
Attachment #303180 -
Flags: superreview?(stuart.morgan)
| Assignee | ||
Comment 21•18 years ago
|
||
(In reply to comment #19)
> (From update of attachment 303176 [details] [diff] [review])
> >+ NSPositionalSpecifier *newToLoc = [[NSPositionalSpecifier alloc] initWithPosition:NSPositionBeginning objectSpecifier:[toLoc objectSpecifier]];
>
> Three things here:
> - Why is this NSPositionBeginning, when the discussion was about putting it at
> the end (which seems more likely to be the expected behavior)?
Yes, this was supposed to be NSPositionEnd, but I used NSPositionBeginning first and somehow I diffed from that version. Sorry I haven't been able to spin a new patch yet. If you can make the the changes on checkin, Stuart, that would be awesome.
Comment 22•18 years ago
|
||
Landed on trunk and MOZILLA_1_8_BRANCH with the comment 19 fixes.
| Reporter | ||
Comment 23•18 years ago
|
||
I checked in an additional fix for comment 18. Farewell bookmark-eating AppleScripts!
One of us needs to update the AppleScript Guide about this.
You need to log in
before you can comment on or make changes to this bug.
Description
•